diff --git a/CLAUDE.md b/CLAUDE.md index 7d1eccd..ba29387 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -80,6 +80,7 @@ All detectors support: `AGGREGATOR_URL`, `CHECK_INTERVAL`, `THRESHOLD_WARNING`, | `/wake` | POST | Exit sleep mode | | `/status` | GET | Current state JSON | | `/events` | GET | List active events | +| `/docs` | GET | Interactive API documentation (Swagger UI) | ### `/notify` Endpoint diff --git a/README.md b/README.md index 0717eba..c72243e 100644 --- a/README.md +++ b/README.md @@ -191,8 +191,9 @@ automation: | `/notify` | POST | Simple notification `{"message": "", "duration": 5}` | | `/sleep` | POST | Enter sleep mode | | `/wake` | POST | Exit sleep mode | +| `/docs` | GET | Interactive API documentation (Swagger UI) | -Full API documentation available in [openapi.yaml](openapi.yaml) (OpenAPI 3.0 spec). +Full API documentation available at [/docs](http://localhost:5100/docs) or in [openapi.yaml](openapi.yaml). ## Personality diff --git a/aggregator.py b/aggregator.py index 9a45745..3f49cb9 100644 --- a/aggregator.py +++ b/aggregator.py @@ -326,6 +326,35 @@ def list_events(): return jsonify({"events": dict(active_events)}), 200 +@app.route("/docs") +def docs(): + """Serve interactive API documentation via Swagger UI.""" + return """ + +
+ +