Expand description
Serving the web UI.
The built SPA is compiled into the binary (ADR 0012): a self-hosted install
is one file, and the UI can never be from a different build than the API it
calls. In development the app is served by Vite, which proxies /api here,
so this path is what a release does rather than what a developer waits for.
The fallback is the whole routing story. A single-page app owns its own
paths, so anything the API has not claimed is answered with index.html
and the browser decides what to draw. Without that, a refresh on /privacy
would 404 - the server has no such file, and only the app knows the route.
Functionsยง
- serve
- Answers a request that no API route matched.