Vercel
- Adapter:
server/adapters/vercel.ts(Edge runtime) - Route entry:
api/admin.ts
Setup
- Import the GitHub repo into Vercel (static output =
distafterbun run build) - Set env vars from
secrets.local.exampleon the Vercel project - Map
api.yourdomain.comto the deployment (or rewrite/api/*toapi/admin) - Set site
VITE_ADMIN_APIto that API origin
ts
// api/admin.ts
export { default, config } from '../server/adapters/vercel'Notes
Use the Edge runtime when you can. The shared handler speaks Web Request and Response, and Edge matches that. Then check that Set-Cookie actually arrives in the browser on your API domain. A platform URL often drops it.