How to run the Dist Folder on Local Machine in Angular 6+?

前端 未结 6 1416
无人共我
无人共我 2020-12-07 16:47

I am building the application in Angular6+, now I have run the command ng build --prod which gave me a dist folder. Now how to check or serve that

6条回答
  •  遥遥无期
    2020-12-07 17:22

    From Terminal:
    $ npm install http-server -g

    From Angular Project Dir. Lets say your Angular project name is ngx.
    $ ng build
    $ http-server dist/ngx
    Starting up http-server, serving dist/ngx
    Available on:
    http://127.0.0.1:8080
    http://192.168.43.54:8080
    Hit CTRL-C to stop the server

    Enjoy!

提交回复
热议问题