Skip to main content
Elysia is a fast and ergonomic web framework built specifically for Bun.

Installation

bun add elysia

Basic Server

server.ts
import { Elysia } from "elysia";

const app = new Elysia()
  .get("/", () => "Hello Elysia")
  .get("/json", () => ({ message: "Hello JSON" }))
  .listen(3000);

console.log(`Server running at http://localhost:${app.server?.port}`);

Type-Safe Routes

import { Elysia, t } from "elysia";

new Elysia()
  .post("/user", ({ body }) => ({
    id: 1,
    ...body
  }), {
    body: t.Object({
      name: t.String(),
      email: t.String()
    })
  })
  .listen(3000);

Elysia Documentation

Learn more about Elysia

Build docs developers (and LLMs) love