Is it possible to use a web.config setting such as "serverPath" below in a JavaScript file in an ASP.NET MVC4 Razor project?
<appSettings>
<add key="serverPath" value="http://myserver" />
</appSettings>
I would like to change the URL of the following jQuery ajax call depending upon debug or release mode
var request = $.ajax({
url: 'http://myserver/api/cases',
type: 'GET',
cache: false,
dataType: 'json'
});
Is is possible to read the value from web.config like a View and substitute it in the .js file?