router

Function router 

Source
pub fn router(state: AdminState) -> Router
Expand description

Create the admin router with all endpoints and middleware.

§Endpoints

  • GET /health - Health check
  • POST /v1/auth/login - Login
  • POST /v1/auth/logout - Logout
  • GET /v1/auth/status - Auth status
  • GET /v1/config - Get config
  • PUT /v1/config - Update config
  • POST /v1/execute - Execute query
  • GET /v1/metrics - System metrics
  • GET / - Serve admin UI index
  • GET /assets/*path - Serve static assets
  • GET /*path - SPA fallback to index.html

§Middleware

Applied in order (outer to inner):

  1. Tracing - Logs requests and responses
  2. Concurrency limit - Prevents resource exhaustion