In my last few posts I introduced the iisnode project and talked about specific aspects of hosting node.js applications in IIS 7.x on Windows:
In this article I am showing how to use the WebMatrix development environment to develop node.js applications and test them in IIS Express using the same iisnode module. WebMatrix is a free, lightweight, Windows based development environment for web application development using a variety of web technologies.
Setting it up
First you need to download and install WebMatrix (free). The download will also include IIS Express, a lightweight version of IIS specifically designed for development purposes.
Next you need to download a recent x86 build of iisnode. Unzip it somewhere on disk.
Note: if you are running 64 bit Windows, you still need to download the x86 build of iisnode, since IIS Express only ships in 32 bit version.
Now install iisnode by calling the installation script from the command line with administrative privileges:
- on a 32 bit Windows system:
- on a 64 bit Windows system:
%systemroot%\syswow64\cmd.exe /C install_iisexpress.bat
If everything goes well, you should see successful installation confirmation:
Take note of the samples directory to use it from WebMatrix in the next step.
Start up WebMatrix
Start up WebMatrix. When prompted, choose “Site from folder”:
Enter the samples path that was shown in the last step of iisnode installation:
You can now explore and modify all node.js samples that came with iisnode installation in WebMatrix:
Right click on index.htm and choose “Launch in browser”. IIS Express will host the samples web site and you will be able to access the node.js sample endpoints exposed from IIS Express:
What did just happen?
WebMatrix with IIS Express gives you a lightweight, free development stack for node.js applications on Windows. IIS Express allows you to exercise the same set of features iisnode exposes in a regular IIS installation, including URL rewriting module.