Skip to main content

Module app

Module app 

Source

Functions§

router
router_with_cors
allowed_origins restricts the browser origins that may call the API. The default is deliberately permissive: this API authenticates with a bearer token and never uses cookies, so the Origin header is not a security boundary — a hardcoded list would only break real deployments (a tailnet hostname, a phone, a different port) while stopping nothing, since a non-browser client ignores CORS entirely.
router_with_web
The API plus the built web client on the same origin, which is what lets a browser reach http://host:8383 and just work.
serve
Serves until ctrl-c. Owning this here is what keeps axum out of the CLI.