How to pass arguments to app using pm2?

user3373581 picture user3373581 · Mar 11, 2015 · Viewed 83.6k times · Source

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.

Answer

Nishchit Dhanani picture Nishchit Dhanani · Aug 29, 2015

If you want to pass node arguments from CLI then

pm2 start myServer.js --node-args="--production --port=1337"

.

Edited

you can add any arguments after --

pm2 start app.js -- --prod --second-arg --third-arg

Sails docs for deploymemt.