Documentation Index
Fetch the complete documentation index at: https://mintlify.com/zhcndoc/bun/llms.txt
Use this file to discover all available pages before exploring further.
Elysia is a fast and ergonomic web framework built specifically for Bun.
Installation
Basic Server
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