I am using iisnode to host a node web application in IIS on Windows. When I set up my routes on the web server (say Express or Restify) I want do do it in a way that is inde
This answer suggests getting the path from the web.config
file.
Also, this link might be of some help as well:
The solution turns out to be well addressed, at least for "express" framework apps using app.use()
When you call app.use(app.router), you can pass a namespace prefix for your virtual directory and then requests will succeed BUT who would want to hard-code their virtual directory name into their app [yuck!]?
The solution turns out to be quite simple because IISNODE promotes appSettings to environment variables. Taking advantage of this fact, you can add an entry to the apps web.config such as:
Then you can make one simple modification to your server.js file like this:
app.configure(function () {
....
app.use(process.env.appvirtdir || '', app.router);
....
});