这里有一些针对上述问题的简单解决方案
iss 上的 Node.js 部署
安装 IISNODE open cmd as admin cd "C:\Program Files\iisnode" (或 "C:\Program Files (x86)\iisnode" 如果您安装的是 32 位版本
键入 setupsamples.bat
使用 Web 安装程序安装 MS URL 重写
使用代码添加 web.config
<configuration>
<system.webServer>
<!-- indicates that the server.js file is a node.js application
to be handled by the iisnode module -->
<handlers>
<add name="iisnode" path="server.js" verb="*" modules="iisnode" />
</handlers>
<rewrite>
<rules>
<rule name="sendToNode">
<match url="/*" />
<action type="Rewrite" url="server.js" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
发布 node.js 项目
将发布的站点粘贴到 inetpub-->wwwroot 以管理员身份运行 cmd 在网站文件夹上运行命令 对于节点
npm install 对于节点 Express npm install express 创建 IIS 网站 开始浏览