OptionalafterObserves the final response after send preparation.
OptionalbeforeRuns after request parsing and context creation.
OptionalbeforeRuns before a framework-neutral response is returned.
OptionalmapMaps unexpected errors to responses.
OptionalnameOptional name used in diagnostics and devtools.
OptionalonObserves framework-caught errors.
OptionalonRuns after route matching and before body/query/header parsing.
Server lifecycle hook collection.
Hooks run in the order they are registered.
onRequestcan short-circuit before context creation;beforeHandlecan replace context or short-circuit;beforeSendcan replace the outgoing response;afterSendobserves the final response.