I use forever to run and monitor the application. So the restart function:
app.get('/restart', function (req, res, next) { process.exit(1); });
After server shutdown, forever restart the service.
Prefixes:
Express server listening on port 3000 in development mode
error: Forever detected script exited with code: 1
error: Forever restarting script for 2 time
Express server listening on port 3000 in development mode
germanlinux
source share