Initializervapor 4.114.1Vapor
init(closure:)
Create a new BasicResponder
.
init(closure: @escaping (Request) async throws -> Response)
Parameters
- closure
Responder closure.
let notFound: Responder = BasicResponder { req in
let res = req.response(http: .init(status: .notFound))
return req.eventLoop.newSucceededFuture(result: res)
}