refactor(api): remove the deprecated /api/stats endpoint

The only consumer (the marketing landing) now uses /api/v1/stats, so drop
the legacy /api/stats route and its handler. Delete src/routes/stats.ts and
its test; repoint the index CORS test at /api/v1/stats.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Julien Herr
2026-05-23 23:15:08 +02:00
parent daa93d8093
commit c2a0a68058
7 changed files with 5 additions and 87 deletions
-2
View File
@@ -34,7 +34,6 @@ Single Cloudflare Worker built with Hono. Routes:
| ------------------------------------ | ---------------------------------------------------------------------- | ------- |
| `GET /` | Public status page (monitoring counters + link to admin) |
| `POST /api/inbound` | Webhook from ForwardEmail; IP-allowlisted to their MX sources |
| `GET /api/stats` | Deprecated alias of `GET /api/v1/stats` (public monitoring counters) |
| `/api/v1/feeds*` | Versioned REST API (Bearer/proxy auth) — feeds + emails CRUD |
| `GET /api/v1/stats` | Public monitoring counters (JSON, CORS); canonical stats endpoint |
| `GET /api/openapi.json` | OpenAPI 3.1 spec (public) |
@@ -65,7 +64,6 @@ src/
files.ts # R2 attachment serving
hub.ts # WebSub hub
home.tsx # Public status page (GET /)
stats.ts # Monitoring counters API (GET /api/stats)
admin.tsx # Admin UI entrypoint (hono/jsx)
admin/ # Admin sub-modules
feeds.tsx # Feeds CRUD UI