Node.js: How To Get Warned When Server Crashes

Donald picture Donald · May 12, 2011 · Viewed 9.1k times · Source

How can I get warned when my server crashes for any reason? Does HopToad or any other service does that?

Thanks

EDIT:

I am using Heroku for node.js. Which doesn't allow me to run anything else. I need something to monit my code from inside out, without needing to run any other process.

Thanks

Answer

yojimbo87 picture yojimbo87 · May 12, 2011

You can try to handle uncaughtException event within your node.js program and do your "warn me" stuff there. Or you can use service like uptime robot to monitor if your app is listening on specified port for example.