Deploy Elysia on Vercel
Elysia can be deployed on Vercel with zero configuration using either Bun or Node runtime.
- In src/index.ts, create or import an existing Elysia server
- Export the Elysia server as the default export
import { Elysia, t } from 'elysia'
export default new Elysia() .get('/', () => 'Hello Vercel Function') .post('/', { body: t.Object({ name: t.String() }) }, ({ body }) => body)- Develop locally with the Vercel CLI
vc dev- Deploy to Vercel
vc deployThat’s it. Your Elysia app is now running on Vercel.
If your pnpm configuration does not install peer dependencies, add the peers required by Elysia v2 explicitly:
pnpm add typebox exact-mirror openapi-typesUsing Node.js
Section titled “Using Node.js”To deploy with Node.js, make sure to set type: module in your package.json
{ "name": "elysia-app", "type": "module"}Using Bun
Section titled “Using Bun”To deploy with Bun, make sure to set the runtime to Bun in your vercel.json
{ "$schema": "https://openapi.vercel.sh/vercel.json", "bunVersion": "1.x"}If this doesn’t work
Section titled “If this doesn’t work”Vercel has zero-configuration support for Elysia. For additional configuration, please refer to the Vercel documentation