Skip to main content

Crate server

Crate server 

Source

Functionsยง

router
Build the HTTP router over db. Read endpoints take the read lock; /ingest takes the write lock. Guards are dropped before any .await. GET /watch upgrades to a WebSocket fed by the post-commit sink.
router_with_auth
router with an optional bearer/?token= requirement on every route except unauthenticated GET /health.
router_with_ui
Same as router_with_auth, then ServeDir as the fallback so API routes win.
run_mcp_stdio
Run the MCP loop until reader hits EOF.
serve
Bind addr (port 0 is ephemeral) and serve.
serve_with_ui
serve plus a UI dist directory mounted behind the API routes.