Installation and Run Node.JS on IIS
Web Server Requirement
- IIS
- URL Rewrite
- Node.js
- IISNode for IIS
server.js
var express = require('express');
var app = express();
app.get('/', function (req, res) {
res.send('Express is working on IISNode!');
});
app.listen(process.env.PORT);
web.config
<configuration>
<system.webServer>
<handlers>
<add name="iisnode" path="server.js" verb="*" modules="iisnode" />
</handlers>
<rewrite>
<rules>
<rule name="sendToNode">
<match url="/*" />
<action type="Rewrite" url="server.js" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
<system.webServer>
<handlers>
<add name="iisnode" path="server.js" verb="*" modules="iisnode" />
</handlers>
<rewrite>
<rules>
<rule name="sendToNode">
<match url="/*" />
<action type="Rewrite" url="server.js" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Comments
Post a Comment