Saturday, January 14, 2012

How to host node as a service, just like IIS in Windows?

Installing node as a service will help us as below.

  • Run in the background
  • Restart automatically if it crashes

Steps:

  1. Install NSSM (non-sucking service manager). This tool lets you host a normal.exe as a Windows service.
  2. Go to command prompt.
  3. Execute nssm.exe install node-service c:\nodejs-path\node.exe c:\code\sample\server.js
  4. Execute net start  node-service
For more information see here.

No comments: