vanja.
vanja.

Reputation: 2572

How to change allowed file types in Azure Static WebApps?

I have a static react app that I deployed via Github & Azure DevOps to a Static WebApp. I can access index.html and robots.txt just fine, but when I try access a file in the same folder with a different extension (.json), the webbrowser fails to GET with 404. Which file extensions are allowed, and how do I add other file extensions to the allow list?

Upvotes: 0

Views: 1105

Answers (1)

Gaurav Mantri
Gaurav Mantri

Reputation: 136186

Based on the documentation available here, the configuration for a Static Web App is defined in staticwebapp.config.json. You can add a section for mime types in that file.

Something like:

"mimeTypes": {
  ".json": "text/json"
},
...other settings

Upvotes: 1

Related Questions