Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I have a RESTful API implemented on nodejs which I have to host on Windows. Now app is just simple RESTful service, maybe in future I will implement the backoffice for it to manage users, display statistic etc. So for now app is just an API, but maybe in future it will be extended to serve few pages with dynamic content, I am not going to provide access to the static content (except regular content for web apps: favicon, images, css, js files etc).

After research I see few options to host my app on Windows:

  1. Use windows service to run the node server.
  2. Use IIS and IISNode module as a front server.
  3. Use Nginx on Windows as a front server (I didn't work with Nginx, but it seems that it can be used to host node and can be used on Windows).

My questions:

  1. As I understood it is better to use some front server. This approach has a lot of benefits: you can manage app state, logs, domain names etc. What are the benefits of using windows service to host the app?

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

like image 800
ntl Avatar asked Nov 11 '14 12:11

ntl


1 Answers

IISNode has a number of benefits which are outlined on the project page. https://github.com/tjanczuk/iisnode/wiki

I would lean that direction primarily because if you have to host it on Windows, that indicates there is someone who knows how to manage Windows servers and that would typically include IIS. If you set up your own Windows service, you become responsible for scalability and recovering the process if it crashes.

like image 60
Timothy Strimple Avatar answered Oct 16 '22 13:10

Timothy Strimple