Proxy /api/v1/events/stats in FastAPI - currently returns 404 #2

Open
opened 2026-05-23 20:54:16 +00:00 by coilysiren · 0 comments
Owner

Originally filed by @coilysiren on 2026-05-18T22:32:30Z - https://github.com/coilysiren/eco-replay/issues/7

Problem - README documents GET /api/v1/events/stats as a public endpoint ({ ready, total }), and the mod implements it. But the FastAPI app at src/eco_replay/main.py only proxies /api/v1/events, so curl http://localhost:4200/api/v1/events/stats returns {"detail":"Not Found"}.

Repro

$ curl -sS http://localhost:4200/api/v1/events/stats
{"detail":"Not Found"}
$ curl -sS -H "X-API-Key: $TOKEN" http://localhost:3001/api/v1/events/stats
{"ready":true,"total":701}

Fix - Add a /api/v1/events/stats proxy route in main.py that forwards to the upstream /stats endpoint with the same X-API-Key header, same mock-fallback shape as the events proxy.

Found while smoke-testing the live-mode wire-up.

_Originally filed by @coilysiren on 2026-05-18T22:32:30Z - [https://github.com/coilysiren/eco-replay/issues/7](https://github.com/coilysiren/eco-replay/issues/7)_ **Problem** - README documents `GET /api/v1/events/stats` as a public endpoint (`{ ready, total }`), and the mod implements it. But the FastAPI app at `src/eco_replay/main.py` only proxies `/api/v1/events`, so `curl http://localhost:4200/api/v1/events/stats` returns `{"detail":"Not Found"}`. **Repro** ``` $ curl -sS http://localhost:4200/api/v1/events/stats {"detail":"Not Found"} $ curl -sS -H "X-API-Key: $TOKEN" http://localhost:3001/api/v1/events/stats {"ready":true,"total":701} ``` **Fix** - Add a `/api/v1/events/stats` proxy route in `main.py` that forwards to the upstream `/stats` endpoint with the same `X-API-Key` header, same mock-fallback shape as the events proxy. Found while smoke-testing the live-mode wire-up.
Sign in to join this conversation.
No labels
P0
P1
P2
P3
P4
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
coilyco-flight-deck/eco-replay#2
No description provided.