Description
The /api route (apps/web/app/api/page.tsx) renders an HTML documentation page instead of returning a JSON 404 for unmatched API routes. When clients call undefined API endpoints, Next.js serves this 28KB HTML page instead of a proper JSON error.
Location
apps/web/app/api/page.tsx — This creates a catch-all page.tsx at /api
Impact
API consumers expecting JSON responses get hard-to-parse HTML back when hitting:
/api (should return JSON description of available endpoints or 404)
- Any unmatched
/api/* route
This breaks client error handling and makes the API less interoperable.
Suggested Fix
Either:
- Move docs to a non-API path like
/docs/api
- Return a JSON response with available endpoints from the
/api route
- Use Next.js
not-found.tsx at the api level for a JSON 404
Description
The
/apiroute (apps/web/app/api/page.tsx) renders an HTML documentation page instead of returning a JSON 404 for unmatched API routes. When clients call undefined API endpoints, Next.js serves this 28KB HTML page instead of a proper JSON error.Location
apps/web/app/api/page.tsx— This creates a catch-allpage.tsxat /apiImpact
API consumers expecting JSON responses get hard-to-parse HTML back when hitting:
/api(should return JSON description of available endpoints or 404)/api/*routeThis breaks client error handling and makes the API less interoperable.
Suggested Fix
Either:
/docs/api/apiroutenot-found.tsxat the api level for a JSON 404