Info: I am very new to node.JS!
I have written a sample server that can listen to http requests on port XXXX. When I run this server from commandline (Windows) it se
I solved it using a proper method. Yes, IISNode it is.. But none of comments seemed to answer how to "run" app.js for different applications hosted on same IIS (which is also serving PHP, ASPX, etc)
Step 1. Edit your node application’s entry-point (typically) app.js for the new URL structure.
An express app assumes that it owns the entire URL space and starts the URLs from the root itself, as shown:
Edit you app.js to look like the following (but put YOUR app’s directory name instead of “aaspass”!!):
Now put a web.config file at the root of your app which looks like the following (You may use this template: webconfig).
Again edit the file and change the name “aaspass” to your app’s directory name.

Thats it! You may do this for as many apps as required and host them on SAME server.
On Windows you have two options of hosting node.js applications:
If you are on Windows you can (and probably should) run Node.js under IIS:
http://www.hanselman.com/blog/InstallingAndRunningNodejsApplicationsWithinIISOnWindowsAreYouMad.aspx
What worked for me:
Add web.config file in your Node.js app/folder. Here are the content of web.config file:
In the handler, I just need to point to app.js (typical entry point of your application). I have not made changed to any of my routes (there is no need to append any text).
..
<configuration>
<appSettings>
<add key="NODE_ENV" value="production" />
</appSettings>
<system.webServer>
<handlers>
<add name="iisnode" path="server/app.js" verb="*" modules="iisnode" />
</handlers>
<rewrite>
<rules>
<clear />
<rule name="cdw">
<match url="/*" />
<action type="Rewrite" url="server/app.js" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>