Getting “404 not found” on doing a GET on local file in Azure web app

后端 未结 1 1263
清酒与你
清酒与你 2020-12-22 05:08

I have deployed a simple node based web app in Azure. Following is the structure of my code:

In my js code, when I do an xhr.get call to my js

相关标签:
1条回答
  • 2020-12-22 05:25

    It's a common issue of Azure Website which be lack of the mimetype setting for static json file, please refer to the blog. You just need to add the configurate below into your web.config file under wwwroot.

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

    Then it works via your browser.

    0 讨论(0)
提交回复
热议问题