Skip to content

Instance Method

respond(to:chainingTo:)

Called with each Request that passes through this middleware.
func respond(to request: Request, chainingTo next: any AsyncResponder) async throws -> Response

Parameters

request

The incoming Request.

next

Next Responder in the chain, potentially another middleware or the main router.

Return Value

An asynchronous Response.

Default Implementations

AsyncMiddleware Implementations