<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <handlers>
      <add name="iisnode" path="server/server.mjs" verb="*" modules="iisnode" />
    </handlers>
    <iisnode node_env="production" />
    <staticContent>
      <remove fileExtension=".wasm" />
      <remove fileExtension=".webmanifest" />
      <mimeMap fileExtension=".wasm" mimeType="application/wasm" />
      <mimeMap fileExtension=".webmanifest" mimeType="application/manifest+json" />
    </staticContent>
    <rewrite>
      <rules>
        <rule name="Release API proxy" stopProcessing="true">
          <match url="^api/releases$" />
          <action type="Rewrite" url="server/server.mjs" />
        </rule>
        <rule name="Angular SSR" stopProcessing="true">
          <match url=".*" />
          <action type="Rewrite" url="server/server.mjs" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>
