Get Started
Installation
Overview
Zeta is available on both JSR and NPM:
bun add @aklinker1/zeta
deno add @aklinker1/zeta
Your First App
Zeta apps require input/output validation and OpenAPI docs. These are two core features required for the app to run:
import { createApp } from "@aklinker1/zeta";
import { zodSchemaAdapter } from "@aklinker1/zeta/adapters/zod-schema-adapter";
import z from "zod";
const app = createApp({
schemaAdapter: zodSchemaAdapter,
openApi: {
info: {
title: "Simple Zeta App",
version: "1.0.0",
},
},
}).get(
"/",
{
description: "Example description",
responses: z.object({
message: z.string(),
}),
},
() => {
return { message: "Hello World!" };
},
);
app.listen(3000, () => console.log("Server started @ http://localhost:3000"));
Then run the app:
bun run main.ts
deno run --allow-net index.ts
The app will have three routes:
- / → Returns "hello world" JSON
- /openapi.json → Returns OpenAPI JSON spec
- /scalar → The Scalar API Reference UI
Next Steps