Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/elysiajs/documentation/llms.txt

Use this file to discover all available pages before exploring further.

Vercel Functions support the Web Standard Request/Response API by default, so Elysia runs on Vercel without any additional configuration or adapters. You can use either the Bun or Node.js runtime depending on your deployment target.
1

Create and export your Elysia app

In src/index.ts, define your Elysia server and export it as the default export.
import { Elysia, t } from 'elysia'

export default new Elysia()
  .get('/', () => 'Hello Vercel Function')
  .post('/', ({ body }) => body, {
    body: t.Object({
      name: t.String()
    })
  })
2

Develop locally with the Vercel CLI

vc dev
3

Deploy to Vercel

vc deploy

Using Node.js

To deploy with the Node.js runtime, set "type": "module" in your package.json:
{
  "name": "elysia-app",
  "type": "module"
}

Using Bun

To deploy with the Bun runtime, set the Bun version in vercel.json:
{
  "$schema": "https://openapi.vercel.sh/vercel.json",
  "bunVersion": "1.x"
}

pnpm peer dependencies

If you use pnpm, install peer dependencies manually:
pnpm add @sinclair/typebox openapi-types
For additional configuration options, refer to the Vercel documentation for Elysia.

Build docs developers (and LLMs) love