justapi — /docs

Built-in Routes

JustAPI registers these routes automatically:

Route Method Auth Description
/health GET No Health check (always returns 200)
/live GET No Liveness probe
/ready GET No Readiness probe (checks registered health checks)
/metrics GET Yes Prometheus metrics
/openapi.json GET Yes OpenAPI 3.1 schema
/docs GET Yes Swagger UI
/redoc GET Yes ReDoc
/scalar GET Yes Scalar API Reference

Enable System Routes

app = JustAPIApp(admin_token="my-secret-token")
app.enable_system_routes()

This mounts additional introspection routes:

Route Description
/_system/help Rich route descriptors (AI-friendly)
/_system/help/{name} Detailed help for one route
/_system/tools List registered MCP tools
/_system/tools/call Invoke a tool by name

Register Health Checks

def check_db():
    db = app.db
    if db.health():
        return True
    raise Exception("Database unreachable")

def check_redis():
    # Check Redis connection
    return True

app.register_health_check("database", check_db)
app.register_health_check("redis", check_redis)

GET /ready returns 200 only if all health checks pass.

Admin Token Protection

Routes like /metrics, /openapi.json, /docs are protected by admin_token:

app = JustAPIApp(admin_token="my-secret-token")

Include the token in requests:

curl -H "Authorization: Bearer my-secret-token" http://localhost:8000/metrics

See Also

JustAPI v2.0.9 — Open Source MIT License · Built with WebTUI · GitHub

NORMAL master justapi/docs
utf-8 Top 1:1