Skip to content

Instantly share code, notes, and snippets.

@freewayspb
Created December 22, 2016 06:03
Show Gist options
  • Save freewayspb/10b69166c2812191872b1329e73d1361 to your computer and use it in GitHub Desktop.
Save freewayspb/10b69166c2812191872b1329e73d1361 to your computer and use it in GitHub Desktop.
azure config for angularjs app with static json files
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=301880
-->
<configuration>
<system.web>
<httpRuntime maxUrlLength="2000" relaxedUrlToFileSystemMapping="true" />
</system.web>
<system.webServer>
<rewrite>
<rules>
<clear />
<!--<rule name="AngularJS Conditions" stopProcessing="true">-->
<!-- <match url="(app/.*|css/.*|fonts/.*|images/.*|js/.*|node_modules/.*|json/.*|html/.*)" />-->
<!-- <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />-->
<!-- <action type="None" />-->
<!--</rule>-->
<!--check if its root url and navigate to default page -->
<!--<rule name="Index Request" enabled="true" stopProcessing="true">-->
<!--<match url="^$" />-->
<!--<action type="Redirect" url="/" logRewrittenUrl="true" />-->
<!--</rule>-->
<!--remaining all other url's point to index.html file -->
<!--<rule name="AngularJS Wildcard" enabled="true">-->
<!--<match url="(.*)" />-->
<!--<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />-->
<!--<action type="Rewrite" url="index.html" />-->
<!--</rule>-->
<rule name="AngularJS" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />
</conditions>
<action type="Rewrite" url="/" />
</rule>
</rules>
</rewrite>
<staticContent>
<mimeMap fileExtension=".json" mimeType="application/json" />
</staticContent>
</system.webServer>
</configuration>
<!--ProjectGuid: 8B1FAEF6-E2E5-417C-9644-60F6F815695D-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment