Skip to content

Commit 855e4b2

Browse files
msujawsclaude
andcommitted
fix(proxy): use rewrite to route nested API paths to handler
Vercel's catch-all route ([...path].ts) wasn't matching nested paths like /api/bugzilla/bug/123 when using the Vite framework. Changed to use explicit rewrite rule that routes all /api/bugzilla/* paths to a single handler at api/bugzilla.ts. Also filters out '...path' query param that Vercel adds for catch-all routes. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent aa4d0d1 commit 855e4b2

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

vercel.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
"buildCommand": "npm run build",
33
"outputDirectory": "dist",
44
"framework": "vite",
5+
"rewrites": [
6+
{
7+
"source": "/api/bugzilla/:path*",
8+
"destination": "/api/bugzilla"
9+
}
10+
],
511
"headers": [
612
{
713
"source": "/(.*)",

0 commit comments

Comments
 (0)