Expand description
The HTTP route table and frontend fallback. Split out of server/mod.rs unchanged (SPEC_LARGE_FILE_MODULE_ANALYSIS_2026_09_30.md §4.1).
Structs§
- SrvRouters
- The two routers srv serves.
fullis every route and is bound on loopback only.lanis whatbackend::lan_listenersbinds on LAN interfaces when LAN discovery is on: the routes a LAN peer calls (all behindlan_or_full_auth_middleware), plus health and the WhatsApp webhook, which authenticate themselves. Nothing that requires the fullauth_keyis served off-host, so a LAN listener has no full-key surface.
Functions§
- build_
routers - Build both routers with all routes, auth middleware, and CORS.
- build_
routers_ 🔒with build_routers, with the frontend directory passed in (headless--frontend-dir, orNone).- with_
frontend 🔒 - Serve the built frontend in
dirfor every path no route claims,/included. Unauthenticated, like the CEF host’s static server: the bundle holds no secrets, and srv’s key still guards every API route. Unknown paths getindex.html. Full router only; the LAN router never serves it.