infra
infra copied to clipboard
Non-existent API routes returns an HTML response
Describe the bug
The UI proxy acts as a catch-all route for incoming requests. This has the side effect of routing any unknown endpoints to the UI even if the route is part of the API, e.g. /api/nonexistent
. The request, being served by the UI, returns a HTML 404 instead of a JSON 404. For an API consumer this will be confusing.
Expected behavior
Requests to /api/*
should return an API response, not a UI response, e.g. a JSON 404 message.
Requests not to /api/*
can return a UI response.