Harthur/brain. Keep a node.js server up with Forever — blog.nodejitsu.com. One of the great benefits of using node.js is the reduction in dependencies needed to run a production web application. By using the 'http' module we can run a stand-alone web server in node.js without the need for a separate server like Apache or nginx. The caveat of not having to use these servers is that their concerns are now the concerns of the node.js application developer. The concern that we will discuss in this article is that of fault tolerance, or how to automatically restart your server when it crashes or enters an invalid state.
Before we dive into how to use Forever, lets setup the 'hello world' web server that we will later run with Forever. The above code starts a web server that will respond to all requests with 'hello, i know nodejitsu' . $ node simple-server.js > hello world running on port 8000 $ nohup node simple-server.js > output.log & [1] 23909 This will start our server process in the background and append all output to 'output.log'. [sudo] npm install forever. Senchalabs/connect. Heroku/faceplate. Express - node web framework. Caolan/async. Socket.IO: cross-browser WebSocket. Express - node web framework.