Forever can be seen as a Nodejs daemon that can start, stop, and restart our app.
1. Global Installation Forever
sudo npm install forever-g
2. Start
//1. Simple Start-upForever Start App.js//2. Specify forever information output file, of course, it will be put to ~/.forever/forever.logForever Start-l Forever.log app.js//3. Specify the log information and error log output files in the app.js.//- o is the Console.log output information,-e is the Console.error output informationForever Start-o Out.log-e err.log app.js//4. Append the log, forever default is not to overwrite the last boot log,//so if the second boot does not add-a, it will not let the runForever Start-l Forever.log-a app.js//5. Listen for all file changes under the current folderForever Start-w App.js
3. File change monitoring and automatic restart
//
4. Show all running services
5. Stop operation
////////
6. Restart operation
The restart operation is consistent with the stop operation.
Forever Restartall
Forever Start Nodejs