forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration options
Arxisos edited this page Jan 2, 2012
·
10 revisions
As you might have seen in the last tutorials, the main configuration is made in the app host.
//Set JSON web services to return idiomatic JSON camelCase properties
ServiceStack.Text.JsConfig.EmitCamelCaseNames = true;//Change the default ServiceStack configuration
Feature disableFeatures = Feature.Jsv | Feature.Soap;
SetConfig(new EndpointHostConfig {
EnableFeatures = Feature.All.Remove(disableFeatures), //all formats except of JSV and SOAP
DebugMode = true, //Show StackTraces in service responses during development
WriteErrorsToResponse = false, //Disable exception handling
DefaultContentType = ContentType.Json //Change default content type,
AllowJsonpRequests = true //Enable JSONP requests
});Note:
DebugModeshould be set to false in production because of security reasons!