Skip to content

Instantly share code, notes, and snippets.

@harvzor
Last active January 17, 2023 00:32
Show Gist options
  • Save harvzor/a6078bbb4dbe9e51fab2 to your computer and use it in GitHub Desktop.
Save harvzor/a6078bbb4dbe9e51fab2 to your computer and use it in GitHub Desktop.
IISNode basic setup
var express = require('express');
var app = express();
app.get('/', function (req, res) {
res.send('Express is working on IISNode!');
});
app.listen(process.env.PORT);
<configuration>
<system.webServer>
<!-- indicates that the server.js file is a node.js application
to be handled by the iisnode module -->
<handlers>
<add name="iisnode" path="server.js" verb="*" modules="iisnode" />
</handlers>
<rewrite>
<rules>
<rule name="myapp">
<match url="/*" />
<action type="Rewrite" url="server.js" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment