-1

I am learning angular 2 and trying to host an app on azure using git.I have no knowledge of git . I am simply following this video. I have already hosted an simple app before

After pushing my app on azure I am getting the error

You do not have permission to view this directory or page.

I am using angular cli so I couldn't find web.config as suggested by other answers on stackoverflow. How to config about setting other environments like angular2 cli where i can't find web.config

1 Answers1

0

Well, you can check out @stas.ivash's answer to find the web.config file in Host Angular2 app with routing in Azure.

Angular 2 by default uses HTML5 routing, you either have to map all server requests to index.html by adding the following to web.config

<rewrite>
    <rules>
        <rule name="redirect all" stopProcessing="true">
            <match url="^(.*)$" ignoreCase="false" />
            <conditions logicalGrouping="MatchAll">
                <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" pattern="" ignoreCase="false" />
            </conditions>
            <action type="Rewrite" url="PATH TO INDEX.HTML" appendQueryString="true" />
        </rule>
    </rules>
</rewrite>
Aaron Chen
  • 9,835
  • 1
  • 16
  • 28
  • Thank you for your response.But from what I understood after reading the answer was to find the web.config file is in the root folder of the site.But I can't find any of those files in my angular 2 app(I am also using angular cli).So Kindly provide me a detailed answer . Thank you – MANOJ VARMA Jun 16 '17 at 21:27
  • Just put the web.config file into `/dist` folder and then push it to the remote repository. – Aaron Chen Jun 19 '17 at 09:52