Created
January 7, 2019 06:00
-
-
Save gabrielepalma/a0fbf1131bff3e255403c8d3029674c0 to your computer and use it in GitHub Desktop.
Store
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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