Why do you use forever with Node.js ?
 forever is a node.js package that is used to keep the server alive even when the server crash/stops. When the node server is stopped because of some error, exception, etc. forever automatically restarts it.
Forever can be used as
forever start app.jsFinally, the purpose of forever is to keep a child process (such as our node.js web server) running continuously and automatically restart it when it exits unexpectedly. forever has some default options and configuration convention as follow:
- foreverkeeps track of running processes in- *.fvrfiles that are placed in- /tmp/forever/pids
- Each foreverprocess will generate a unique log file placed in/tmp/forever/*.log
- Unless otherwise specified, the output of the child process' stdoutandstderrwill be written to the above log file.
Comments
Post a Comment