﻿<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <staticContent>
      <remove fileExtension=".json" />
      <mimeMap fileExtension=".json" mimeType="application/json" />
	  <mimeMap fileExtension="woff" mimeType="application/font-woff" />
      <mimeMap fileExtension="woff2" mimeType="application/font-woff" /> 
    </staticContent>
    <!-- IIS URL Rewrite for Angular routes -->
    <rewrite>
      <rules>
        <rule name="Angular Routes" 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>

    <!-- <validation validateIntegratedModeConfiguration="false"/> -->
    <httpErrors errorMode="Custom" defaultResponseMode="Redirect">
    
      <!-- 500 Internal Server Error -->
      <remove statusCode="500" subStatusCode="-1" />
      <error statusCode="500" prefixLanguageFilePath="" path="/assets/offline.html" responseMode="ExecuteURL" />

      <!-- 503 Service Unavailable -->
      <remove statusCode="503" subStatusCode="-1" />
      <error statusCode="503" prefixLanguageFilePath="" path="/assets/offline.html" responseMode="ExecuteURL" />

      <!-- 521 Web Server Is Down -->
      <remove statusCode="521" subStatusCode="-1" />
      <error statusCode="521" prefixLanguageFilePath="" path="/assets/offline.html" responseMode="ExecuteURL" />
    </httpErrors>
    
  </system.webServer>
</configuration>