Expand description
Embedded HTTP server for the forgetop web dashboard.
It’s a thin frontend over the same SectionService / health services the TUI uses —
no logic fork. Wave 1 is a read-only JSON API + a placeholder page, bound to 127.0.0.1
and gated by a per-session token so no other local process or web page can reach it.
Structs§
- Deps
- The services the dashboard reads from and writes through — the same ones the TUI is given, so connections added here show up in the TUI (and vice versa).
- Server
- A bound, running server: where it lives and the token needed to reach it.
Constants§
- DEFAULT_
PORT - Default dashboard port.
0lets the OS pick a free one.
Functions§
- serve_
blocking - Bind + serve until the process exits (headless
--dashboard). Callson_readywith the URL once bound so the caller can open the browser. - spawn
- Bind + serve in the background, returning the URL (with token) for the caller to open.
Best-effort: an
Errjust means “no dashboard” — the TUI should carry on regardless.