Expand description
Axum HTTP server for the trusty-console.
Why: The console needs a lightweight HTTP server that serves the embedded
SPA, a JSON API route for service status, and a reverse-proxy layer for
all daemon sub-paths.
What: Builds an axum Router with:
GET /health— liveness probe.GET /api/console/services— return cached snapshot (background poll).GET /api/console/metrics/{analyze,memory,search,review,mpm}— MCP-polled metrics.GET /api/console/metrics/analyze/indexes— analyze index list via stdio MCP.GET /api/console/metrics/analyze/visualize?index=<id>— graph+entities+clusters.…/api/console/sessions/*— the single HTTP front door for the trusty-mpm session manager (#1222); handlers live incrate::routes::sessions.ANY /proxy/{daemon}/{*path}— reverse-proxy to live daemon (mpm is NOT in the proxy allowlist — operators use/api/console/sessions/*instead).GET /andGET /ui/*path— serve the embedded Svelte SPA.
All logs go to stderr; stdout is clean.
Test: The tests module starts the router in a real axum test client.
Structs§
- AppState
- Shared application state injected into every route handler.
Functions§
- build_
router - Build the axum
Routerwith all routes wired.