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:
parent
0531f25cbb
commit
2f4336889d
1 changed files with 1 additions and 5 deletions
|
|
@ -1,11 +1,7 @@
|
||||||
{
|
{
|
||||||
"rewrites": [
|
"rewrites": [
|
||||||
{
|
{
|
||||||
"source": "/api/(.*)",
|
"source": "/((?!api|static|_next).*)",
|
||||||
"destination": "/api/$1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "/(.*)",
|
|
||||||
"destination": "/index.html"
|
"destination": "/index.html"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue