0

After building my react project it creates a bundle of files .js .json and index.html files.

I created a windows web app in azure.

When I deploy the bundle the page loads but none of the .json files do not load. I have seen other examples they talk webconfig changes but since this is a react project that does not apply.

1 Answer 1

3

I manually add a web.config in 'dist/prod' with the following to make it work.

<?xml version="1.0"?> <configuration> <system.webServer> <staticContent> <mimeMap fileExtension=".json" mimeType="application/json" /> </staticContent> </system.webServer> </configuration> 

try it. Note this for only static json files if your going to look dynamic content.you need add handler in config.files

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.