Skip to main content

run_http_on

Function run_http_on 

Source
pub async fn run_http_on(state: AppState, listener: TcpListener) -> Result<()>
Expand description

Run the optional HTTP/SSE + web admin server.

Why: A long-running daemon mode lets non-stdio clients (browsers, curl, future remote agents) hit /health, the /api/v1/* REST surface, and the embedded admin SPA. What: axum router built from web::router() plus a /sse stub for the existing MCP-over-SSE clients. Caller provides a pre-bound listener so port auto-detection lives at the call site. Test: cargo test -p trusty-memory-mcp web::tests exercises the router shape; manual: curl http://127.0.0.1:<port>/health returns ok.