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.

Elysia is built on top of the Web Standard Request/Response API, which means it runs on Deno without any additional adapter. You simply pass app.fetch to Deno.serve instead of calling .listen().
1

Create your Elysia app and pass it to Deno.serve

Replace .listen() with Deno.serve(app.fetch):
import { Elysia } from 'elysia'

const app = new Elysia()
  .get('/', () => 'Hello Elysia')

Deno.serve(app.fetch)
2

Run the server with deno serve

deno serve --watch src/index.ts
The --watch flag enables hot-reload on file changes.

Changing the port

Pass a configuration object as the first argument to Deno.serve to set a custom port:
Deno.serve({ port: 8787 }, app.fetch)

pnpm peer dependencies

If you use pnpm, install peer dependencies manually:
pnpm add @sinclair/typebox openapi-types

Build docs developers (and LLMs) love