I had a problem in an Express NodeJs website I make where I use SVG and other files like Fonts.
When I ran the app locally I didn't have problem. But when I had to put it on Azure, all files like SVG and Fonts did not appear anymore.
I created a web.config file at root of 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>
Also did as they told here (Svgs and other mime types in windows azure)
Both solutions permit me to access SVG files, but the problem is that now I am not able to see my webpages ! (HTTP 500)
It seems it overrides configuration for dynamic Content. What sould I do to configure dynamic Content to work again ?
I found the problem. Which was simple. I needed to use the solution here (Svgs and other mime types in windows azure)
But in the configuration of the Dynamic Content, instead of calling server.js, I needed to call app.js, because of my Express website, which runs in app.js (default).
The final result is :
<?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>