-
Notifications
You must be signed in to change notification settings - Fork 0
Example Projects
The spray source code repository contains a folder calles spray-examples that contains a number of example projects
demonstrating different aspects of spray-server.
This example defines a simple REST service offering basic calculations. This is its service definition.
This examples shows how spray can be used to serve up static files from JAR resources.
Its MarkdownService trait defines a custom media type for markdown files that are being served under the "/doc" path from a JAR resource "directory". The example uses a simple response transformation to convert content with the "text/x-markdown" type to HTML using pegdown.
The Stopwatch example is a somewhat more elaborate example demonstrating, among other things, custom marshallers and method tunneling via query parameters. This is its main service definition.
If you have a particularly clever example for a spray-server service we'd be more than happy to include it (as is the case with all contributions).
- 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