Skip to content

feat: Implement a global 404 Not Found route handler #14

@AlAfiz

Description

@AlAfiz

Description

When a user hits an API route that doesn't exist, the server just hangs or returns a generic HTML error. We need a standard JSON response for missing endpoints so the frontend can handle it easily.

Requirements

  • Add a catch-all route (app.use('*', ...)) at the very bottom of the route declarations.
  • Return a 404 HTTP status.
  • Return a simple JSON body: { "error": "Route not found" }.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions