[英]How to deploy node.js application and node.js express applicaion on IIS
我已经在Visual Studio 2019上创建了Node.js应用程序,我想在IIS上部署它。
如何在本地系统上的IIS上部署Node.js应用程序和Node.js Express应用程序
我尝试了许多解决方案,但没有一个完全有用。下面的链接有些有用,但令人困惑,而且内容很多,请阅读https://www.hanselman.com/blog/InstallingAndRunningNodejsApplicationsWithinIISOnWindowsAreYouMad.aspx
以admin cd“ C:\\ Program Files \\ iisnode”(如果安装了32位版本,则为“ C:\\ Program Files(x86)\\ iisnode”)安装IISNODE open cmd
使用代码添加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>
将发布的站点粘贴到inetpub上-> wwwroot在站点文件夹上以admin run命令运行cmd对于节点
npm install对于Node Express,npm install express创建IIS网站开始浏览
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.