Is there a way to declare multiple API routes from a single file in Arrow?
Example: Say you want to declare multiple endpoints for a user API:
- GET /api/user/:id
- DELETE /api/user/:id/delete
- POST /api/user
It would make sense to keep these in the same file since they are related and could share code, instead of splitting them into their own files.
I'm referring to these docs.
At this moment the only way to keep them in the same file is to use
ALL
as the method and then in the action usereq.method
to delegate to the right logic. E.g.: