Skip to content

You're viewing documentation for a pre-release version. View the latest stable version

Instance Method

respond(to:chainingTo:)

Called with each Request that passes through this middleware.
func respond(to request: Request, chainingTo next: any Responder) 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

Middleware Implementations