Postmedia/timbits — Issue #15: Timbits on IISNode Paths Config Options Needed
Author: pmwilliamson
Created: 2012-02-07 14:25:52+00:00
State: open

The path specified for app.get must be the full path of the request under IIS and will vary based on the configuration.

The current workaround is to manually update all @server.get or @server.all paths in timbits\lib\timbits.coffee with the full path from IIS.

```
A simple express application we will host in IIS looks like this:

1: var express = require('express');
2:
3: var app = express.createServer();
4:
5: app.get('/node/express/hello/foo', function (req, res) {
6: res.send('Hello from foo! [express sample]');
7: });
8:
9: app.get('/node/express/hello/bar', function (req, res) {
10: res.send('Hello from bar! [express sample]');
11: });
12:
13: app.listen(process.env.PORT);
```

Two key aspects to call out that may be different from your bread & butter express app are:

1.	The path specified in app.get calls must be the full path of the request (lines 5 and 9). When your app is hosted in IIS, depending on the configuration you may not necessarily own the entire namespace over port 80. Like in the example above, your IIS hosted express application may reside in the ‘express’ folder of the ‘node’ virtual directory, and only own the subordinate URL namespace.

2.	Similarly to a non-express node.js app hosted in iisnode, the listen port is provided by IIS through the PORT environment variable. When you start your listener (line 13), this is the port you should specify.

Please see Installing express on Windows for more info:

http://tomasz.janczuk.org/2011/08/hosting-express-nodejs-applications-in.html