Litestar Lifecycle Hooks

Apply Litestar request lifecycle hooks with `before_request`, `after_request`, and `after_response` for request enrichment, short-circuiting, response mutation, post-send side effects, and layered cross-cutting behavior around handler execution. Use when logic should run immediately before the handler, after the response object is resolved, or after the response has been sent. Do not use for startup/shutdown ownership, `before_send` / `after_exception` / `on_app_init`, decoupled event fanout, or raw ASGI wrapping that belongs in app setup, events, or middleware.

alti3 f407541 4 files · 13.7 KB Updated

File contents

alti3/litestar-skills/tree/main/plugins/litestar/skills/litestar-lifecycle-hooks commit f4075418c5

Frequently asked questions

npx skillmds@latest add alti3/litestar-lifecycle-hooks