I had the opportunity to work with many Node.js applications in the past, and those applications were generally launched in the general manner.

Node appname

Recently, I ventured into hosting Node.js applications, including React applications on a web server, specifically, React applications on IIS, and this is what I've learnt.

In order to get Node.js applications to run on IIS, do the following:

  1. install iisnode.
  2. publish your React code by running npm run build
  3. Then, create a new website and point to the build directory that's generated by react.
  4. Place web.config into that directory.

That's all that is to it, surprisingly!

Initially, I ran into a lot of issues trying to figure out the correct combination of tags for web.config, given that most articles and blog posts for iisnode are dated at least 1-2 years ago.

But I finally managed to sort it out!