How Can I run PM2 with Angular-Cli? - Angular2

前端 未结 7 859
夕颜
夕颜 2020-12-30 07:33

How can I run: ng serve --prod with pm2?

ng serve from angular-cli, Angular2. I\'m running on DigitalOcean.

I have tried to test with ht

7条回答
  •  甜味超标
    2020-12-30 07:54

    This command would work as expected:

    after I run

    ng build --prod

    then run the following command in the dist/ folder

    pm2 start /usr/bin/http-server -- -p 8080 -d false

    Update

    I have found a better solution: which ng then it will print /usr/bin/ng then type this

    pm2 start /usr/bin/ng -- serve --prod

提交回复
热议问题