Skip to content

Instantly share code, notes, and snippets.

@vmilev
Last active August 9, 2020 05:00
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save vmilev/cf8ef05c2d77fc8aedd6c5831d724a77 to your computer and use it in GitHub Desktop.
Save vmilev/cf8ef05c2d77fc8aedd6c5831d724a77 to your computer and use it in GitHub Desktop.
Sample web.config for Angular 4 CLI app
<?xml version="1.0"?>
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".json" mimeType="application/json" />
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
<mimeMap fileExtension=".woff2" mimeType="font/woff2" />
</staticContent>
</system.webServer>
<system.webServer>
<rewrite>
<rules>
<rule name="angular cli routes" 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment