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_role_tokens
router with a full-access token and a map of role-bound tokens.
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_with_role_tokens
[serve] with role-bound tokens in addition to the optional full-access token.
serve_with_ui_and_role_tokens
[serve_with_ui] with role-bound tokens.