Web Server
Use this skill for HTTP behavior under crates/web-server.
Handler Structure
- Organize routes under
crates/web-server/handlers/<feature>/. - Put GET request handling in
loader.rs. - Put POST and form mutations in
actions.rs, with functions namedaction_*. - Use
mod.rsto re-export handlers and define the featureroutes()helper. - Wire typed paths from
crates/web-pages/routes.rsinto the matching handler.
Loaders should authenticate and authorize before reading data, call the
appropriate generated database queries, and render the matching page function
from crates/web-pages. Actions should validate input, authorize the mutation,
call database functions, and return the established redirect or rendered error
path.
Follow existing Axum extractors, error types, transaction handling, and authorization helpers. Do not trust team, user, ownership, or conversation identifiers supplied by clients or model tools; derive and verify them through the authenticated context.