I'm currently using forever to run my node.js application in our development environment. What I am currently struggling with is how to pass node.js arguments when using "forever start"
Here is an example where I need to pass a number and a date to node. It's not working so any help would be appreciated.
forever -c 'node 8010 "2014-11-11 12:00:00"' start app.js
js application locally after closing the terminal or Application, to run the nodeJS application permanently. We use NPM modules such as forever or PM2 to ensure that a given script runs continuously. NPM is a Default Package manager for Node.
The purpose of Forever is to keep a child process (such as your node. js web server) running continuously and automatically restart it when it exits unexpectedly.
Forever is an npm package used to keep your script running continuously in the background. It's a handy CLI tool that helps you to manage your application in the development and production stages. To start running a script with forever, use the forever start command, followed by the script name.
According to the StackShare community, PM2 has a broader approval, being mentioned in 74 company stacks & 107 developers stacks; compared to forever, which is listed in 3 company stacks and 3 developer stacks.
According to the documentation, the script arguments come after the call. https://github.com/nodejitsu/forever
usage: forever [action] [options] SCRIPT [script-options]
forever start app.js 8010 "2014-11-11 12:00:00"
The usage of nconf https://github.com/flatiron/nconf in your project is highly recommended to grab those params.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With