How to save a node server application on a Windows server

I am working on a project and I modified the sample node.js 'simple chat room' application for my need, it works great.

I need to call the server url (.js file) to launch it before opening the client page in the browser while everything is working fine. But if the node server application is disconnected for any reason (server reboot, iis reboot, etc.), the Client page returns an error.

My question is: how can I support the node server application all the time, even after interrupting it. How can I do this without a monitor or script that runs every x minutes.

I am using IIS 7.5 and iisnode modules.

thanks

+4
source share
4 answers

Run the script file as a service with nssm .

+6
source

I am not sure about starting node in iis. However, you can see the node forever , pm2 and nodemon that will restore the instance in the event of a failure.

Here's how to install node.js as a service

Here's something about installing node in iis 7.5


Just an update.

I have been using iisnode at work for most of the year. I would recommend it if you are deploying Windows.

+2
source

Pretty sure you want jesus

Installation

 $ npm install -g jesus 

Using

Start monitoring server

 $ jesus daemon /path/to/server.log 

To start the process

 $ jesus start <id> node /path/to/my-app/index.js 

To stop one

 $ jesus stop <id> 

To stop everything

 $ jesus stopall 
+2
source

https://github.com/isaacs/node-supervisor and https://github.com/remy/nodemon are slightly different functions, but are not specific to Windows and still work on Windows, unlike many other more popular , but incomplete options, such as eternity and eternity (today in any case).

0
source

Source: https://habr.com/ru/post/1498494/


All Articles