Configuring IIS node.js with Windows Server 2012
- Before proceeding further we need to install below mentioned application:-
- Download Node JS for Window (https://nodejs.org/en/download/).
- Now for Installing IIS node, search for IIS node on Web Platform Installer then click on add then click on Install.

- Then open Web Platform Installer type URL Rewrite and then install the package.

- Create a folder into C drive or as per you need.
- After creating the folder provide the full write permission to the IIS_ user for managing the folder.

-
Install Express and http-server in the myapp directory or the folder which you have created use below mentioned commands in command prompts:-
- npm install express --save
- npm install http-server

- Now Open IIS server manager right click on the IIS server, click on Add website.

- Add new website popup will appear.

- Add the application pool for the selected website.

- Provide the Site name, website directory URL, then click on OK to continue.

- Once the express package is installed in the folder run below sample code for checking weather configuration is done properly or not. save below mentioned code in the name of app.js or as per your choice.
var express = require("express");
var app = express();
app.get("/", function(req, res) {
res.send("Hello Worlxxxxd!");
});
// This is REQUIRED for IISNODE to work
app.listen(process.env.PORT, () => {
console.log("listening");
});
- Also make sure in webconfig file provide the default page name in below mentioned point in image.

- Now access your website on your browser.
