Runs immediately before the server starts listening.
Hook body
Runs after shutdown completes.
Hook body
Runs when an error escapes middleware or a handler.
Hook body receiving the error and request context
Runs after all plugins have registered.
Hook body
Runs during the owning plugin's registration.
Hook body
Runs at the start of every request.
Hook body receiving the request context
Runs after every response is produced.
Hook body receiving the request context
Runs when shutdown begins — close connections, flush buffers here.
By this point the application is already refusing new requests and the
server socket is closed; use onStopping for work that must
happen while traffic is still being served.
Hook body
Runs at the very start of stop(), before the application begins
refusing new requests.
This is the only hook that runs while the application is still serving
normally, which is what makes it the right home for "tell the outside
world to stop sending me traffic" work — deregistering from a service
registry, for instance. Deregistering in onShutdown instead
means the socket is already closed by the time the registry hears about
it, so callers keep being routed to a dead port for up to one health-check
interval on every rolling deploy.
Hooks run LIFO and are awaited, so a slow hook delays the whole shutdown
and a rejecting one surfaces from stop() — but only after the shutdown
has completed, because a hook failure must not be able to prevent the
application stopping. With no hooks registered this
window has zero width and stop() behaves exactly as it did before.
Hook body
Lifecycle hook registration surface. Hooks run in registration order within each phase.
Since
0.1.0