node.js - Express NodeJS web.config in Azure for SVG & Fonts -
node.js - Express NodeJS web.config in Azure for SVG & Fonts -
i had problem in express nodejs website create utilize svg , other files fonts.
when ran app locally didn't have problem. when had set on azure, files svg , fonts did not appear anymore.
i created web.config file @ 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 told here (svgs , other mime types in windows azure)
both solutions permit me access svg files, problem not able see webpages ! (http 500)
it seems overrides configuration dynamic content. sould configure dynamic content work 1 time again ?
i found problem. simple. needed utilize solution here (svgs , other mime types in windows azure)
but in configuration of dynamic content, instead of calling server.js, needed phone call app.js, because of express website, runs in app.js (default).
the final result :
<?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>
node.js azure svg web-config mime-types
Comments
Post a Comment