在iisnode的web.config for Express中设置规则

在iisnode中提供的例子只处理一个文件(比如hello.js),并且在web.config文件中设置了一个规则:

 <!-- indicates that the hello.js file is a node.js application to be handled by the iisnode module --> <handlers> <add name="iisnode" path="hello.js" verb="*" modules="iisnode" /> </handlers> <rewrite> <rules> <rule name="myapp"> <match url="myapp/*" /> <action type="Rewrite" url="hello.js" /> </rule> </rules> </rewrite> 

当处理普通的快速应用程序时,我们应该使用bin/www作为默认启动。

我目前只是replacebin/www hello.js ,是这样做的正确方法?

要使用重写规则在IISNode中运行Express应用程序,只需指定您的Express应用程序的主文件,然后就可以了。 无需分配bin/www