How to run Node.js on IIS
In this
post you will learn how to run Node.js applications on IIS Server. As you know,
Node.js is an open source, cross-platform runtime environment for server-side
and networking applications. This is mostly written in JavaScript, and can be
run within the Node.js runtime itself installed on Windows, Linux etc. Node.js
was originally invented in 2009 by Ryan Dahl, and other developers working at Joyent.
So,
there is standalone node run-time available to run Node application on Windows,
Linux etc, but there are some sort of requirement when we host Node.js web
applications on IIS. In this case we need to fire-up live node server from IIS,
so that standalone run-time is not required.
In this
post I'll walk you through steps to ready IIS Server to host Node.js
Applications.
Step 1
Install
IISNode Module on IIS Server, you can download this module from https://github.com/tjanczuk/iisnode
When
you open above link, you will see x86 or x64 binaries, click to download you
binary.
Once
you done, step ahead.
Step 2
Setup an
IIS Website and create a server.js file on the application root and try to
access http://localhost:port/server.js
file. Once you see output like below, means Node.js application is up and
running on IIS Server.
Even if
you see some sort of error when Node.js starts, ignore them as of now, all you
need to see is HTTP 200 Response.
In case you would like to watch the steps mentioned above, here is recorded screen-cast.
In case you would like to watch the steps mentioned above, here is recorded screen-cast.
Hope
this helps.
Comments
Post a Comment