Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass parameters to the node app via command #652

Closed
Globegitter opened this issue Aug 25, 2014 · 3 comments · May be fixed by hixio-mh/pm2#5 or qsays/pm2#30
Closed

Pass parameters to the node app via command #652

Globegitter opened this issue Aug 25, 2014 · 3 comments · May be fixed by hixio-mh/pm2#5 or qsays/pm2#30

Comments

@Globegitter
Copy link

I have seen you can define args in the processes.json, but it would be really ideal to pass arguments directly to the app, ideally how forever does it, or otherwise exactly how the --node-args flag works.

To give a proper example, I can run my SailsJS app with certain parameters like sails lift --prod or sails lift --verbose I would love to somehow run pm2 start app.js --prod or pm2 start app.js --args="--prod"

Or is that somehow already possible?

@soyuka
Copy link
Collaborator

soyuka commented Aug 25, 2014

$ pm2 start app.js -i max -- -a 23  # Pass arguments after -- to app.js

Or, in your case:

$ pm2 start app.js -- --prod

@Globegitter
Copy link
Author

I really shouldn't try to read a Readme at 1AM in the morning - thanks.

@souravtyson
Copy link

i tried to run the node application with pm2 as
pm2 start pm2.config.json -- --prod --prof

but the prof file is not generated.
Can anyone help me with this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants