I've tried to add a MIME type to the webmatrix web.config file to run in Azure:
<system.webServer>
<staticContent>
<mimeMap fileExtension=".json" mimeType="application/json" />
</staticContent>
</system.webServer>
But I get a 500 (Internal Server Error) when trying to load a json file.
The site works locally.
Is there something else in Azure I need to do?
(Edit:)
All I have in web.config is:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SqlServerCe.4.0" />
<add invariant="System.Data.SqlServerCe.4.0" name="Microsoft® SQL Server® Compact 4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
</DbProviderFactories>
</system.data>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".json" mimeType="application/json" />
</staticContent>
</system.webServer>
</configuration>
The bit without the MIME type was generated by webMatrix.
Error in console:
GET http://carlistings.azurewebsites.net/CarListings/data/cars.json?_dc=1364378861597&page=1&start=0&limit=25 500 (Internal Server Error)
UPDATE
The file doesn't change and is called by JavaScript from a Sencha Architect tutorial app.
{
"img" : "2004_Porsche_911_Carrera_type_997.jpg",
"manufacturer" : "Porsche",
"model" : "911",
"price" : 135000,
"wiki" : "http://en.wikipedia.org/wiki/Porsche_997",
"quality" : [{
"name" : "overall",
"rating" : 1
},{
"name" : "mechanical",
"rating" : 4
},{
"name" : "powertrain",
"rating" : 2
},{
"name" : "body",
"rating" : 4
},{
"name" : "interior",
"rating" : 3
},{
"name" : "accessories",
"rating" : 2
}]
}
UPDATE 2
I've noticed that running the app locally (where the app runs properly) the error log shows the cars.json file as application/json, whereas on the Azure server, it shows it as text/html.
It appears the Azure server is ignoring my web.config file with something else...
(I've enabled debugging in Azure but can't find a list of errors yet...)