Skip to content

Instantly share code, notes, and snippets.

Created August 23, 2011 19:58
val baseService = new Service[HttpRequest, HttpResponse] {
def apply(request: HttpRequest) =
Future(new DefaultHttpResponse(HTTP_1_1, OK))
}
val authorize = new RequireAuthorization(...)
val handleExceptions = new HandleExceptions(...)
val decoratedService: Service[HttpRequest, HttpResponse] =
handleExceptions andThen authorize andThen baseService
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment