How to set Default page in Angular

后端 未结 1 435
深忆病人
深忆病人 2021-01-26 00:35

I am getting an error when I request the link with this URL: http://xxx:46630/ or with this http://crmbyzaid.azurewebsites.net/

But it is worki

相关标签:
1条回答
  • 2021-01-26 01:03

    Since Azure is running on IIS, you need a web.config to tell it how to handle stuff.. This should solve your root-page:

    <configuration>
        <system.webServer>
            <rewrite>
              <rules>
                <rule name="Main Rule" stopProcessing="true">
                        <match url=".*" />
                        <conditions logicalGrouping="MatchAll">
                            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                        </conditions>
                        <action type="Rewrite" url="/" />
                    </rule>
                </rules>
            </rewrite>
        </system.webServer>
    </configuration>
    

    Name the file web.config and save it to your web-root.

    Hope that helps!

    0 讨论(0)
提交回复
热议问题