Dashboard root GET /api/dashboard returns 404 — route mismatch with frontend #24

Closed
opened 2026-05-14 13:22:27 +00:00 by Mark · 1 comment
Owner

Bug

GET /api/dashboard returns 404, but the working endpoint is at GET /api/dashboard/stats.

Root Cause

In backend/src/api/routes/dashboard.ts, routes are registered as:

  • GET /dashboard/stats
  • GET /dashboard/backup-trend
  • GET /dashboard/target-usage

These get the /api prefix from Fastify's scoped registration, so the full paths are /api/dashboard/stats, /api/dashboard/backup-trend, /api/dashboard/target-usage. But there is no root GET /api/dashboard endpoint.

Evidence

$ curl -s http://localhost:3001/api/dashboard
{"message":"Route GET:/api/dashboard not found","error":"Not Found","statusCode":404}

$ curl -s -H "Authorization: Bearer $TOKEN" http://localhost:3001/api/dashboard/stats
{"data":{"totalVolumes":0,...}}

Expected

Either GET /api/dashboard should return the stats summary, or the frontend should call /api/dashboard/stats.

Severity

ORANGE High — If the frontend calls /api/dashboard on load, the dashboard page will show no data.

## Bug `GET /api/dashboard` returns 404, but the working endpoint is at `GET /api/dashboard/stats`. ## Root Cause In `backend/src/api/routes/dashboard.ts`, routes are registered as: - `GET /dashboard/stats` - `GET /dashboard/backup-trend` - `GET /dashboard/target-usage` These get the `/api` prefix from Fastify's scoped registration, so the full paths are `/api/dashboard/stats`, `/api/dashboard/backup-trend`, `/api/dashboard/target-usage`. But there is no root `GET /api/dashboard` endpoint. ## Evidence ``` $ curl -s http://localhost:3001/api/dashboard {"message":"Route GET:/api/dashboard not found","error":"Not Found","statusCode":404} $ curl -s -H "Authorization: Bearer $TOKEN" http://localhost:3001/api/dashboard/stats {"data":{"totalVolumes":0,...}} ``` ## Expected Either `GET /api/dashboard` should return the stats summary, or the frontend should call `/api/dashboard/stats`. ## Severity ORANGE **High** — If the frontend calls `/api/dashboard` on load, the dashboard page will show no data.
Author
Owner

Closed by pipeline sweep — no code changes required (blocked:no-changes). Fixer now auto-closes this case going forward.

Closed by pipeline sweep — no code changes required (blocked:no-changes). Fixer now auto-closes this case going forward.
Mark closed this issue 2026-05-20 19:38:57 +00:00
Sign in to join this conversation.
No description provided.