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.js
Finally, 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:
forever
keeps track of running processes in*.fvr
files that are placed in/tmp/forever/pids
- Each
forever
process will generate a unique log file placed in/tmp/forever/*.log
- Unless otherwise specified, the output of the child process'
stdout
andstderr
will be written to the above log file.
Comments
Post a Comment