Reputation: 1
when am trying forever server.js its showing warning messages as warn: --minUptime not set. Defaulting to: 1000ms warn: --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms
how to overcome this and keep my server on forever?
Upvotes: 0
Views: 1988
Reputation: 5407
There are multiple options to 'daemonise' a Node.js server, you could use screen or tmux to run the shell in the background - tmux being the my recommended choice in that situation.
If you want to stick to a node.js toolset, the lightest weight option would be forever, however if you're looking for a more advanced solution you should check out pm2.
I used to run processes with a tmux session, I then moved to forever, but found it a chore to use in a multi-user environment, I've been using PM2 for some time now with no issues.
Upvotes: 4
Reputation: 8060
forever start -l forever.log -o out.log -e err.log server.js
https://github.com/foreverjs/forever#usage
Upvotes: 1