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:
MythEclipseandClaude Fable 5 committed 2026-06-10 21:17:21 +07:00
1 parent f58a92e2aa
commit 591c1fa199
2 files changed
+394 -5

No files matched your search

+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" }
]
}