Deploying Node.js production. Part 1: Using pm2.
Once the development is complete - you are ready to share your application or with the world. Here comes the question: how exactly do you deploy it? Obviously, you can't just run "node main.js" and leave it like that. If the application crashes due to untested error or out of memory, you don't want your service to be interrupted. Instead the applicatoin should be automatically restarted, giving you some extra time to investigate the issues.
NOTE: have you completed my other tutorials about building Node.js web chat and web game?