Diadem Technologies Hosting Knowledgebase

Enable node.js with IIS

Article ID: 1266
Last updated: 26 Jul, 2020

Configuring IIS node.js with Windows Server 2012

  1. 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.

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

  1. 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

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

  1. Add new website popup will appear.

  1. Add the application pool for the selected website.

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

     

  1. 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");
    });

  1. Also make sure in webconfig file provide the default page name in below mentioned point in image.

  1. Now access your website on your browser.

This article was:  
Report an issue
Article ID: 1266
Last updated: 26 Jul, 2020
Revision: 4
Views: 65
Comments: 0