我在Visual Studio 2017社區版中遵循了您的步驟。當我將快速應用發佈到Azure Web App時,我的瀏覽器出現以下錯誤。
The page cannot be displayed because an internal server error has occurred.
經過一番調查,我固定它由Web.config
文件更改爲這樣的事情:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
</staticContent>
<modules runAllManagedModulesForAllRequests="false" />
<iisnode watchedFiles="web.config;*.js;routes\*.js;views\*.pug" />
<handlers>
<add name="iisnode" path="bin/www" verb="*" modules="iisnode" />
</handlers>
<rewrite>
<rules>
<rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true">
<match url="^bin/www\/debug[\/]?" />
</rule>
<rule name="StaticContent">
<action type="Rewrite" url="public{REQUEST_URI}" />
</rule>
<rule name="DynamicContent">
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True" />
</conditions>
<action type="Rewrite" url="bin/www" />
</rule>
</rules>
</rewrite>
<security>
<requestFiltering>
<hiddenSegments>
<remove segment="bin" />
</hiddenSegments>
</requestFiltering>
</security>
</system.webServer>
</configuration>
此外,web.config
文件可以在https://github.com/projectkudu/kudu/wiki/Using-a-custom-web.config-for-Node-apps找到。
希望這會幫助你。
謝謝。這解決了我的問題。歡呼亞蘭。 – Aram