What is the best way to host a node.js application on Windows?

I have a RESTful API implemented on nodejs that I have to host on Windows. Now the application is a simple RESTful service, perhaps in the future I will implement a back office to manage users, display statistics, etc. So, while the application is just an API, but perhaps in the future it will be expanded to serve several pages with dynamic content. I am not going to provide access to static content (other than regular content for web applications: favicon, images, css, js files, etc.).

After researching, I see several options for placing my application on Windows:

  1. Use the Windows service to start the host server.
  2. Use IIS and the IISNode module as the front server.
  3. Use Nginx on Windows as the front server (I did not work with Nginx, but it seems that it can be used to host the node on Windows as well).

My questions:

  1. As I understand it, it is better to use some kind of front server. This approach has many advantages: you can manage application state, logs, domain names, etc. What are the benefits of using the Windows service to host the application?

  2. How to choose between IIS and Nginx. Is it wise to use Nginx on Windows, does it have any advantages?

+8
source share
1 answer

IISNode has several advantages that are listed on the project page. https://github.com/tjanczuk/iisnode/wiki

I would lean in this direction primarily because if you need to host it on Windows, it means that there is someone who knows how to manage Windows servers and, as a rule, enable IIS. If you configure your own Windows service, you become responsible for the scalability and recovery of the process if it works.

+4
source

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


All Articles