The only required change in node app will be port number - use process.env.PORT
value instead of specific numeric in you server.js/app.js as stated in the official /src/samples/express/hello.js (notice the last line):
var express = require('express');
var app = express.createServer();
app.get('/node/express/myapp/foo', function (req, res) {
res.send('Hello from foo! [express sample]');
});
app.get('/node/express/myapp/bar', function (req, res) {
res.send('Hello from bar! [express sample]');
});
app.listen(process.env.PORT);
Also make sure that asp.net's web.config have sections for node (taken from /src/samples/express/web.config):
<configuration>
<system.webServer>
<!-- indicates that the hello.js file is a node.js application
to be handled by the iisnode module -->
<handlers>
<add name="iisnode" path="hello.js" verb="*" modules="iisnode" />
</handlers>
<!-- use URL rewriting to redirect the entire branch of the URL namespace
to hello.js node.js application; for example, the following URLs will
all be handled by hello.js:
http://localhost/node/express/myapp/foo
http://localhost/node/express/myapp/bar
-->
<rewrite>
<rules>
<rule name="myapp">
<match url="myapp/*" />
<action type="Rewrite" url="hello.js" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>