-
Notifications
You must be signed in to change notification settings - Fork 527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nitro returns error differently for /api and /routes #2201
Comments
Your repo link is just the starter project? 🤔 I'd argue that this makes sense as server routes rather return "markup" by default while an API returns JSON by default. |
@manniL Fixed the link 🙈 Based on the docs This PR partially fixes the problem by allowing to rename the route prefix #1763 |
@pi0 Is it intentional that Personally I dont want the |
@pi0 Just ran into this again. What is the purpose of current My suggestion:
|
Additionally I found a bug for current latest v2 as well as v3 nightly: Reproduction:
|
Environment
Operating System: Linux
Node Version: v18.18.0
CLI Version: 3.10.1
Nitro Version: 2.9.1
Package Manager: [email protected]
Reproduction
https://stackblitz.com/edit/github-zyt6se?file=routes%2Ffoo.ts,api%2Ffoo.ts,public%2Findex.html
Describe the bug
Check the response for
/api/foo
and/foo
endpoints. Each of them throws same 404 error in the handler, but:/foo
-> returns error as html page/api/foo
-> returns error as json object as expectedAdditional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: