When you have a React App hosted on IIS Server, you might need to access the static json files in your application for various purposes like json translations etc.
When you try to access these static files directly in browser or through code e.g. http://app/translation.json, you’ll get a 404 File Not Found error because the MIME type is not set by default in IIS. This is true for any other static file like woff files for fonts.
Under your Web.config file configuration section, place the below sample code within system.webServer tags.
<staticContent> <mimeMap fileExtension=".woff" mimeType="application/octet-stream" /> <mimeMap fileExtension=".json" mimeType="application/json" /> </staticContent>
The Web.config file is not available by default for a React App. You can either create one manually or make a change in the IIS Server Website configuration which will generate the Web.config file automatically and then you can add the above changes.