I am attempting to run my expressJS app continuously on a server using forever-monitor. I don't get any errors however my app does not keep running as expected, the process exits after 3 restarts. Can I omit the max value here or what am I missing to run the app continuously?
Info: I am deploying it to a AWS lightsail server.
the code I have implemented comes from the forever-monitor git repo.
var forever = require('forever-monitor');
var child = new (forever.Monitor)('app.js', {
max: 3,
silent: true,
args: []
});
child.on('exit', function () {
console.log('program has exited after 3 restarts');
});
child.start();
I had to install both forever and forever-monitor dependencies to get the app running continuously. The application runs as expected now after closing the CLI session.