It means to let the node. js program run in IIS. Refer to this article hosting express node. js applications in IIS using iisnode.
I will refer to this article installing and running node. js applications within IIS on Windows-Are you mad?. It's actually quite clear, but it's just because it's too long.
Wcat (Web capacity analysis tool) has gone. I thought it was over ~~ As a result, the website cannot be run. You need to manually write web. config to add handler, OK, and the Native node program is running. As a result, the website in Express was not running again. After the solution was finally solved, the link was serialized as follows:
- Download and install node. Note that the 64-bit version of node is installed under the 64-bit program filesfolder. If you download the 32-bit version, you can directly download node.exe to the 32-bit program files directory and create a new nodejs folder;
- Download and install iisnode. If your c: \ Program Files (x86) \ nodejs \ node.exe does not exist, it will report an error and exit. This is the reason why I am prompted for this first step, after installation, the administrator can execute setupsamples in the installation directory. BAT can be immediately experienced, not necessary;
- Download and install the URL rewrite package, which is required by express
- Publish your node website to IIS, for example, http: // localhost: 8081. the. NET version of the application pool is optional and meaningless.
Do two things after publishing a website:
1. Change the listening port to process. env. port, for example, in Express: app. set ('Port', process. env. port | 3000); in this way, the IIS port can be retained and the node servo website can use a custom port (such as port 3000;
2. Add the Web. config file under the root directory of the website and add the following content:
<configuration> <system.webServer> <!-- indicates that the hello.js file is a node.js application to be handled by the iisnode module -->
In this way, all URLs starting with/are taken over by App. JS, and App. JS is registered as an HTTP handler and the iisnode module is used. At this time, a standard Express can run normally.
Finally, I used angular. I just tried to see if the above URL rewrite would take over the angular URL route. The actual test would not. If angular or other frameworks were used for SpA (single-page application) there is no problem with the program because these frameworks are all routed by switching the hash method. It is too late to test if the URL is completely changed by GitHub, And there is time to add the test results.
P.s. when we introduced the installation and configuration process above, we talked about the bat program that can be used immediately after iisnode is installed. In fact, we recommend that you execute it, it will generate a node virtual path under the default website, which contains a wealth of examples and instructions, especially the above Web. the Config File also contains many configurable items. The configuration/readme.htm file contains detailed descriptions. We recommend that you perform this operation and read it in detail.