Using IISNode to host Node.js Web Apps in IIS

Download node.js eBook

Remarks

Virtual Directory / Nested Application with Views Pitfall

If you're going to be using Express to render views using a View Engine, you'll need to pass the virtualDirPath value in to your views

`res.render('index', { virtualDirPath: virtualDirPath });`

The reason for doing this is to make your hyperlinks to other views host by your app and static resource paths to know where the site is being hosted without needing to modify all views after deployment. This is one of the more annoying and tedious pitfalls of using Virtual Directories with IISNode.

Versions

All of the examples above work with

  • Express v4.x
  • IIS 7.x/8.x
  • Socket.io v1.3.x or greater

Related Examples

Stats

146 Contributors: 1
Sunday, September 11, 2016
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook