-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Description
Which project does this relate to?
Start
Describe the bug
API Route precedence isn't working correctly when using two files in a directory such as
resource/$resourceId.ts- implements a GET methodresource/batch.ts- implements a POST method that takes a payload with a list of resource ids to fetch in bulk.
When you call POST /resource/batch you get back a 405 method not allowed error instead of the expected 200.
Your Example Website or App
None, discussed in discord
Steps to Reproduce the Bug or Issue
- Add route using createAPIFileRoute at
/resource/$resourceId.tswith aGEThandler. - Add route using createAPIFileRoute at
/resource/batch.tswith aPOSThandler. - Call
POST /resource/batchand get back a 405.
Expected behavior
I should get back a 200 because POST /resource/batch exactly matches a defined route which should take precedence over a parameterized route.
Screenshots or Videos
No response
Platform
- OS: macOS
- Browser: Chrome and curl
- Version: v133
Additional context
I'm submitting this bug report after a conversation with Manuel in the Discord #start channel today, where he helped me figure out why i was getting a 405 method not allowed when calling an endpoint that was defined.
Metadata
Metadata
Assignees
Labels
No labels