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 """ + + + + Kao API Documentation + + + + +
+ + + +""" + + def main(): port = int(os.environ.get("PORT", 5100)) diff --git a/index.html b/index.html index edb4cae..9bc8b65 100644 --- a/index.html +++ b/index.html @@ -217,7 +217,7 @@ const emoteEl = document.getElementById("emote"); const messageEl = document.getElementById("message"); const POLL_INTERVAL = 2000; - const VERSION = "v1.3.1"; + const VERSION = "v1.3.2"; // Sound system let audioCtx = null;