forked from spray/spray
-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
Mathias edited this page Jul 26, 2011
·
5 revisions
spray supports a number of configuration parameters that you can use to tweak sprays behavior.
These config setting reside next to the akka section in your akka.conf file, in a section called spray.
The [Template Project][] comes with a very basic configuration that you can use as the basis for own.
Currently spray supports the following config settings:
- "root-actor-id", a string containing the id of the [RootService][] actor. You should rarely need to change this. The default is "spray-root-service"
- "timeout", an integer value representing the number of milliseconds in which a request has to be responded before triggering an async timeout error response. The default is 1000.
- "set-connection-close-header", a boolean value signifying whether spray should add a
Connection: closeheader to all responses not already having aConnectionheader. The default istrue. - "set-date-header", a boolean value signifying whether spray should add a proper
Dateheader to all responses. The default isfalsesince most of the time the web server / servlet container you deploy you spray app in already takes care of setting theDateheader. - "root-path", an optional string that, if set, is expected as a prefix of all requests URI paths received by the application and automatically removed before route processing. Useful for example in servlet containers where the spray application is deployed under a certain base URL. The default is "not set".
- "compact-json-printing", a boolean value signifying whether spray should use the
CompactPrinterrather than thePrettyPrinterwhen using [SprayJsonMarshalling][] (also see the Marshalling and Unmarshalling chapter). The default isfalse.
Additionally the spray config section may contain a sub section called users which contains username / password
combinations for the [FromConfigUserPassAuthenticator][] as discussed in the Authentication/Authorization chapter.
Example:
spray {
timeout = 1000
users {
alice = "banana"
bob = "coconut"
}
}
- Home
- Requirements
- spray-server
- ... Getting Started
- ... Key Concepts
- ...... Request Lifecycle
- ...... Routes
- ...... Directives
- ...... Composing Directives
- ...... Rejections
- ...... Marshalling and Unmarshalling
- ... Predefined Directives
- ...... Method Filters
- ...... Path Filters
- ...... Parameter Filters
- ...... Form-Field Filters
- ...... Marshalling/Unmarshalling
- ...... Caching
- ...... Detach
- ...... Encoding/Decoding
- ...... Authentication/Authorization
- ...... File and Resource Directives
- ...... Misc Directives
- ... Advanced Topics
- ...... Case Class Extraction
- ...... Custom Directives
- ...... Custom Media Types
- ...... Custom Error Responses
- ... Configuration
- ... Testing
- ... Example Projects
- spray-client
- Patch Policy
- Credits
- Sponsors