Hi Guys,
In this brief post I am going to show you how to disable or turn off metadata completely.
The main configuration is made in the app host Configure method. I believe you have access to that CS file. in your configure method add this line
EnableFeatures = Feature.Csv | Feature.CustomFormat | Feature.Html | Feature.Json | Feature.Markdown , // you can add more features here but don't add metadata, I have enable few because I need those. This can be done another way but I find this method clear
So my Configure method looked like this
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
public override void Configure(Funq.Container container) { //Signal advanced web browsers what HTTP Methods you accept. base.SetConfig(new EndpointHostConfig { GlobalResponseHeaders = { { "Access-Control-Allow-Origin", "*" }, { "Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS" }, }, EnableFeatures = Feature.Csv | Feature.CustomFormat | Feature.Html | Feature.Json | Feature.Markdown , AllowJsonpRequests = true, }); base.Routes .Add("/index", "GET") ; } |
I hope this helps
Cheers,
Advertisement
Leave a Reply