Node.js Using IISNode to host Node.js Web Apps in IIS

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

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


Got any Node.js Question?