Serve physical JSON files with .json extension using ServiceStack
I'm trying to get a static .json file from my angular $ http request, but it seems the ServiceStack has a handle for all * .json requests. Is it possible to get a physical json file?
Here is the error I am getting:
Forbidden
Request.HttpMethod: GET
Request.PathInfo: /app/resources/menu/administrator.json
Request.QueryString:
Request.RawUrl: /app/resources/menu/administrator.json
+3
source to share
1 answer
By default, ServiceStack only serves static files with preconfigured secure file extensions .
You can add static files .json
to the allowed whitelist with:
SetConfig(new HostConfig {
AllowFileExtensions = { "json" },
});
+2
source to share