【发布时间】:2020-07-31 01:57:20
【问题描述】:
我有一个想要在 Windows IIS 服务器上运行的 Nest.js 应用程序。 我已经安装了 iisnode 模块 github.com/tjanczuk/iisnode 并在 IIS 上创建了一个新网站和应用程序
我能够调用我的 Api 端点但收到以下消息:
警告:由于安全性和可用性问题,不推荐使用 Buffer()。请改用 Buffer.alloc()、Buffer.allocUnsafe() 或 Buffer.from() 方法。
问题是我不使用 Buffer() 我的代码,它只用于我项目中使用的一些节点模块。
在我花更多时间解决已弃用的警告之前,我只是想确定一下,通常是否可以使用 iisnode 在 IIS 上运行 nest.js 应用程序?
非常感谢您的帮助
这是我的 web.config 文件
<configuration>
<system.webServer>
<!-- indicates that the hello.js file is a node.js application
to be handled by the iisnode module -->
<handlers>
<add name="iisnode" path="main.js" verb="*" modules="iisnode" />
</handlers>
<rewrite>
<rules>
<!-- Do not interfere with requests for node-inspector debugging -->
<rule name="sendToNode">
<match url="/*" />
<action type="Rewrite" url="main.js" />
</rule>
</rules>
</rewrite>
...
</system.webServer>
</configuration>
'''
【问题讨论】:
-
IISNode 是为在 Azure App Service 上提供 Node.js Web 应用程序而开发的,当时那里只有 Windows 操作系统。但是,Azure 应用服务现在完全支持 Linux/Docker,因此此类项目(IIS 上的 Node.js/Python)已停止维护(github.com/Azure/iisnode 已闲置两年)。实际上,这是一个提示,您不应该尝试在 IIS 上运行 Node.js。你能切换到 Linux 吗?
-
您好 Lex Li,感谢您的快速回答。不,很遗憾没有:-(
标签: windows iis nestjs iisnode