Expand description
The axum router, app state, the printer-source seam + fake source, and the HTTP API (reads + control).
Auth model: reads (/api/status, /api/ws) are always open; writes
(control) are gated by an optional password (None = open). The token concept
is gone — there’s nothing to put in a URL.
PrinterSource/Controller are the seams that keep the API testable without a
real printer: tests and --fake use FakeSource/[FakeController]; live
mode uses super::LiveSource/super::control::LiveController.
Structs§
- AppState
- Shared server state.
- Fake
Source - A fake source for
--fakemode and tests, backed by awatchchannel so it can stream like the real one.FakeSource::idleis static;FakeSource::rampingsimulates a running print (temps climb toward target, progress advances) so the live charts have moving data to draw.
Traits§
- Printer
Source - Something that can provide the printer’s current status and a live stream of
updates. Abstracted so the server is testable without a network: tests and
--fakemode useFakeSource, the live source (P2) wraps the MQTT monitor.
Functions§
- router
- Build the API router: open reads, password-gated writes, and — when the
dashboardfeature is on — the embedded SPA as the fallback.