Express NodeJS web.config in Azure for SVG and fonts

I am having a problem on an Express website that uses SVG and other files like fonts.

There was no problem running the application locally, but after deploying to Azure, SVG and fonts no longer displayed.

Created a file web.configin the root of the project:

<?xml version="1.0" encoding="utf-8"?>
  <configuration>
    <system.webServer>

      <staticContent>
        <mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
        <mimeMap fileExtension=".woff" mimeType="application/x-woff" />
        <mimeMap fileExtension=".ttf" mimeType="application/x-woff" />
      </staticContent>

    </system.webServer>
  </configuration>

This solution is also used: ( Svgs and other mime types in windows azure )

Both solutions now allow you to download SVG files, but web pages no longer load. (HTTP 500)

It seems to override the configuration for Dynamic Content .

How to configure dynamic content to reuse the application?

+5
source share
1

.

: (Svgs mime azure )

server.js app.js, , Express.

:

<?xml version="1.0" encoding="utf-8"?>
  <configuration>
    <system.webServer>

      <staticContent>
        <mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
        <mimeMap fileExtension=".woff" mimeType="application/x-woff" />
        <mimeMap fileExtension=".ttf" mimeType="application/x-woff" />
      </staticContent>

      <handlers>
        <add name="iisnode" path="app.js" verb="*" modules="iisnode" />
      </handlers>

      <rewrite>
        <rules>
          <rule name="DynamicContent">
            <match url="/*" />
            <action type="Rewrite" url="app.js" />
          </rule>
        </rules>
      </rewrite>

    </system.webServer>
  </configuration>
+9

All Articles