Files
stack/apps/backend/api/index.ts
T
mantrakp04 551d1cb38c Scaffold Vercel serverless serving for Elysia backend
Add a second tsdown entry (src/server/vercel.ts -> dist/vercel.mjs, no-listen handler bundle), a thin api/index.ts Vercel function that re-exports it, and a vercel.json rewrite routing all paths to the function. Needs real-deploy verification (native-dep tracing, rewrite path preservation).
2026-06-19 13:30:44 -07:00

22 lines
857 B
TypeScript

// Vercel serverless entry for the Elysia backend.
//
// We do NOT bundle the whole backend graph here (the `@/*` and `next/*` alias
// resolution + heavy native deps are handled by tsdown). Instead this thin
// function re-exports the already-built handler bundle (`dist/vercel.mjs`,
// produced by `tsdown` during `turbo build`), and Vercel's function builder
// only has to trace the externalized native deps (prisma, sharp, bcrypt,
// oidc-provider, pg) from node_modules.
//
// All requests are routed here via the `rewrites` rule in vercel.json, so the
// Elysia app does its own routing/version-rewrite against the original URL.
import app from "../dist/vercel.mjs";
export const config = {
runtime: "nodejs",
maxDuration: 60,
};
export default function handler(request: Request): Response | Promise<Response> {
return app.handle(request);
}