Forever Node.JS Express 4 Forever Node.JS Express 4 express express

Forever Node.JS Express 4


Try this:

forever start ./bin/www

Let's take a look to package.json:

"scripts": {    "start": "node ./bin/www"},

I guess when we call npm start, ./bin/www will be executed at some point.Then look at the content of./bin/www:

var server = app.listen(app.get('port'), function() {  debug('Express server listening on port ' + server.address().port);});

so we are ready to listen for connections.


forever start --minUptime 1000 --spinSleepTime 1000 ./bin/www


If you use npm start to run your app, this works in place of it:

forever start -c "npm start" /path/to/app/dir/

Source: https://github.com/foreverjs/forever/issues/540