use node.js express on iis with iisnode

2019-09-19 09:47发布

问题:

I got a node.js express application and i need to make it run on my local IIS server so i can send valid http requests to it and work with the responses.

I am using win 10 and IIS 10.

I followed the different guides about working with iisnode in order to use node.js application on IIS.

https://github.com/tjanczuk/iisnode

I also managed to run the tests, so the iisnode is installed, valid and is working together with my IIS.

The "built-in" test is being executed under the default web site which comes with IIS, it creates a new application under it from which there is a working access to the different examples.

My problem is that i am still lacking some information about how to setup my own node.js app on IIS since this information seems to be lacking. And later on how to overcome issues with invalid http requests.

HTTP status: 500
HTTP subStatus: 1001
HTTP reason: Internal Server Error

回答1:

I would advice to follow the next guide,

https://harveywilliams.net/blog/installing-iisnode

combined with the official github page of iisnode, it has all the details about making a simple express node.js app working from scratch with iisnode on IIS.

I would advice to test each part before moving on to the next and once done testing to start first from a minimalistic and simple app of your own and once everything is working build it up from there.

P.S. The reason for this error for me was bad naming when i used express.routing