node.jsiiskoa

What is modern way to hosting `node.js` applications on Windows 10 and Windows Server 2012 and newer?


I want to know how to deploy my node.js application (it uses Koa) on Windows 10, Windows server 2012 and newer.

In Internet I see old tips for using iisnode, but at the same time I see that people worry that developers no answer for many important questions (related with iisnode) and long time doesn't make changes to the iisnode code sources. :(

What is modern way to hosting node.js applications on Windows 10 and Windows Server 2012 and newer?

I would be grateful for link to step-by-step article.


Solution

  • There are a few ways you can run NodeJS on Windows for production workloads.

    It's important to first understand that Windows has built-in (kernel mode!) support for HTTP servers called HTTP.sys which IIS and other web-servers use to serve HTTP traffic rather than simply opening a listening socket on port 80 (this is how Microsoft's IIS beat the pants off Apache in the web-server benchmarks back in the late 1990s).

    Your options are:


    Regarding Azure's fork of iisnode:

    As it's 2024 now, and because the azure/iisnode fork hasn't made any releases since 2017, I felt I should do a quick-check to see how, exactly, Azure employs iisnode; for example, to see if they have a private build.

    ...and I found Azure is runnning a private build 2.27.0 of their fork of IISNode which was built in January 2018, while the last public release was 2.26 in Feb 2017.

    ...but if you want 2.27 to download for yourself, I've exfiltrated the binaries from Azure and posted them to a related Issue in their repo.

    Interestingly, there have been a bunch of commits made since 2.27 was built, so most people are better-off making their own build of iisnode rather than using the exfiltrated binaries above.