Fix Vercel API routing configuration

🔧 Routing Fix:
- Remove redundant API rewrite rule that was causing conflicts
- Use negative lookahead regex to exclude API routes from frontend rewrites
- Only rewrite non-API, non-static routes to index.html
- This should resolve API endpoints returning HTML instead of JSON

🚀 Expected Result:
- /api/* routes will now properly reach Vercel functions
- Frontend routes will still work correctly
- Static assets remain unaffected
This commit is contained in:
Randall Stillwell 2025-07-21 21:40:19 -05:00
parent 0531f25cbb
commit 2f4336889d

View file

@ -1,11 +1,7 @@
{ {
"rewrites": [ "rewrites": [
{ {
"source": "/api/(.*)", "source": "/((?!api|static|_next).*)",
"destination": "/api/$1"
},
{
"source": "/(.*)",
"destination": "/index.html" "destination": "/index.html"
} }
], ],