我在 Azure 上建立了一个 NodeJS 网站,以便从 github 持续部署。不幸的是,我的 github 项目的结构方式是根不是网站。
github_root
|_ app(nodejs website)
|
|_ docs
|
|_ blah
Azure(IIS) 似乎正在 github_root 中寻找 server.js。
有没有办法将 IIS 指向网站的“app”文件夹?
最佳答案
使用 IIS 服务器部署在 Windows Azure 上的 Node.js 应用程序 iisnode
- 允许托管 Node.js 应用程序的 native IIS 模块。
您可以在 web.config
中指定哪个文件是您的主应用程序文件,例如
<configuration>
<system.webServer>
<!-- // configure your node.js application file here -->
<handlers>
<add name="iisnode" path="your_application_file.js" verb="*" modules="iisnode" />
</handlers>
<!-- ... // other configuration parameters .... -->
<system.webServer>
<configuration>
您可以在 Tomasz Janczuk 的(iisnode 创建者)blog 上找到更多示例(包括 URL 重写等)。 .
我希望这会对您有所帮助或给您正确的指导。
关于node.js - 将 Azure Webroot 指向不同的文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19669666/