Instance Method
respond(to:chainingTo:)
Called with each
Request that passes through this middleware.Parameters
requestThe incoming
Request.nextNext
Responderin the chain, potentially another middleware or the main router.
Return Value
An asynchronous Response.
Default Implementations
AsyncMiddleware Implementations
func respond(to: Request, chainingTo: any AsyncResponder) async throws -> ResponseCalled with eachRequestthat passes through this middleware.func respond(to: Request, chainingTo: any AsyncResponder) async throws -> ResponseCalled with eachRequestthat passes through this middleware.func respond(to: Request, chainingTo: any Responder) -> EventLoopFuture<Response>Called with eachRequestthat passes through this middleware.
Middleware Implementations
func respond(to: Request, chainingTo: any Responder) -> EventLoopFuture<Response>Called with eachRequestthat passes through this middleware.func respond(to: Request, chainingTo: any Responder) -> EventLoopFuture<Response>Called with eachRequestthat passes through this middleware.