How to add production mode to sailsjs app when started using PM2

后端 未结 7 1967
心在旅途
心在旅途 2021-01-13 06:57

To start sailsjs in production mode you append --prod.

Run: node app.js --prod

I\'m using PM2 and a simple json file for settings,

相关标签:
7条回答
  • 2021-01-13 07:48

    For pm2 if you have created ecosystem.config.js which you should create in the first process according to this official document. By default it will consider development mode and if you want to change then first delete the previous instance with following command.

    pm2 delete <ID|APP_NAME|SCRIPT|ALL|JSON>
    

    Then you start the instance with following command.

    pm2 start ecosystem.config.js --env production
    

    And to check the process tail the logs of pm2 with following command.

    pm2 logs
    
    0 讨论(0)
提交回复
热议问题