在 Azure 连续交付自定义节点应用上部署



我有一个节点应用程序,它既有反应原生前端,也有节点API

我希望能够为两个文件夹运行 npm install,然后让它运行启动命令"节点服务器"(节点/服务器/索引.js)来运行节点应用程序。

但我似乎无法弄清楚实现这一目标的发布任务。

我正在使用连接到在线视觉工作室的预览连续交付

在我看来,这与持续交付无关。由于 Azure 应用服务在 Microsoft IIS 上运行,因此需要有一个名为web.config的 IIS 配置文件,并且应包含以下部分以满足你的要求:

<handlers>
<add name="iisnode" path="./node/server/index.js" verb="*" modules="iisnode"/>
</handlers>

这表示node/server/index.js文件是由 iisnode 模块处理的节点.js站点。

<rewrite>
<rules>
<!-- First we consider whether the incoming URL matches a physical file in the /public folder -->
<rule name="StaticContent">
<action type="Rewrite" url="public{REQUEST_URI}"/>
</rule>
<!-- All other URLs are mapped to the node.js site entry point -->
<rule name="DynamicContent">
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True"/>
</conditions>
<action type="Rewrite" url="./node/server/index.js"/>
</rule>
</rules>
</rewrite>

这些重写规则确定静态内容和动态内容应位于何处。

对于完整的web.config文件,您可以查看此帖子。

最新更新