I hope you have installed nodejs. Then you need to install “forever”
forever, developed by nodejitsu, has functions to create applications that are always running—”forever” running. If the application dies, forever brings it back. It has built-in functionality to monitor processes. It also offers an API you can use to incorporate its features into your own code.
forever can be installed using npm. npm should have been installed as part of Node.js:
Running the app
Create the file index.js with the following contents:
Now we can use forever to manage our application:, instead of running the above command.
Stopping the app is similar: