fix: add Vercel-compatible relay handler and fix vercel.json runtime

- Create api/relay.ts: Vercel serverless function handler that reuses
  relay logic from src/lib/relay-utils.ts and src/middleware/
- Export default fetch handler (no Bun.serve()) for Vercel Functions
- Fix vercel.json: use @vercel/node@5 runtime with proper routing via
  rewrites to catch all traffic to the relay handler
- Remove stale buildCommand/outputDirectory (Vercel handles function builds)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
MythEclipse
2026-06-10 21:17:21 +07:00
co-authored by Claude Fable 5
parent f58a92e2aa
commit 591c1fa199
2 changed files with 394 additions and 5 deletions
+6 -5
View File
@@ -1,9 +1,10 @@
{
"buildCommand": "bun install",
"outputDirectory": "dist",
"functions": {
"src/index.ts": {
"runtime": "bun@1"
"api/relay.ts": {
"runtime": "@vercel/node@5"
}
}
},
"rewrites": [
{ "source": "/(.*)", "destination": "/api/relay" }
]
}