Alvaro Alvaro - 2 months ago 12x
Node.js Question

iisnode won't run Express

I'm trying to run express using iisnode. I followed the examples provided but when trying to use the latest Express version with a basic example, there's no way to make it work.

I'm getting the error

Cannot GET /node/parislight/hello.js
and other times, just a
The webpage cannot be found

My created a
file (main express file) taken from the express docs.

var express = require('express')
var app = express()

app.get('/', function (req, res) {
res.send('Hello World!')

var server = app.listen(process.env.PORT, function () {

var host = server.address().address
var port = server.address().port

console.log('Example app listening at http://%s:%s', host, port)


I added the necessary
file (extracted from the express example within iisnode)


<!-- indicates that the hello.js file is a node.js application
to be handled by the iisnode module -->

<add name="iisnode" path="hello.js" verb="*" modules="iisnode" />

<!-- 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:



<rule name="myapp">
<match url="myapp/*" />
<action type="Rewrite" url="hello.js" />


I gave all the necessary permissions to the used App Pool in IIS.


It needs to use the full path:

The path specified in app.get calls must be the full path of the request.


Looking like this now:

app.get('/node/parislight/myapp/demo', function (req, res) {
  res.send('Hello World!')

Acceding to it through: