How to pass arguments to app using pm2?

后端 未结 10 1169
予麋鹿
予麋鹿 2020-12-07 17:29

I am using pm2 to start my app but i am not able to pass argument to it. the command I am using is pm2 start app.js -- dev. Though this works with forever.

10条回答
  •  死守一世寂寞
    2020-12-07 17:55

    From the pm2 docs

    //Inject what is declared in env_production
    $ pm2 start app.js --env production 
    
    //Inject what is declared in env_staging
    $ pm2 restart app.js --env staging
    

提交回复
热议问题