Skip to content

Instantly share code, notes, and snippets.

@gabrielepalma
Created January 7, 2019 06:00
Show Gist options
  • Save gabrielepalma/a0fbf1131bff3e255403c8d3029674c0 to your computer and use it in GitHub Desktop.
Save gabrielepalma/a0fbf1131bff3e255403c8d3029674c0 to your computer and use it in GitHub Desktop.
Store
func store(_ req: Request) -> Future<Bool> {
return req.eventLoop.future(true)
}
func submit(_ req: Request) throws -> Future<HTTPStatus> {
return try req.content.decode(Bool.self).then({ res -> EventLoopFuture<Bool> in
return store(req)
}).map({ bool -> HTTPStatus in
.ok
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment