public protocol Middleware
Middleware is placed between the server and your router. It is capable of
mutating both incoming requests and outgoing responses.
Middleware can choose
to pass requests on to the next
Middleware in a chain, or they can short circuit and
return a custom
Response if desired.
Types Conforming to
Helper for creating authentication middleware.
AsyncMiddlewareis placed between the server and your router. It is capable of mutating both incoming requests and outgoing responses.
AsyncMiddlewarecan choose to pass requests on to the next
AsyncMiddlewarein a chain, or they can short circuit and return a custom
Middleware that adds support for CORS settings in request responses. For configuration of this middleware please use the
Captures all errors and transforms them into an internal server error HTTP response.
Serves static files from a public directory.
Emits a log message containing the request method and path to a
Request's logger. The log level of the message is configurable.
Uses HTTP cookies to save and restore sessions for connecting clients.
Called with each
Request that passes through this middleware.