Skip to content

KoritsuA File-based routing API framework

Built with Bun, featuring automatic OpenAPI documentation generation

Koritsu LogoKoritsu Logo

Badges ​

NPM VersionNPM DownloadsLicense

Quick Start ​

  1. Install the package
bash
bun install koritsu
  1. Create the server entry point
typescript
// index.ts
import { Api } from "koritsu";

new Api({
  server: {
    routes: {
      dir: "./routes", // Directory containing your route files
    },
  },
}).start();
  1. Create your first route
typescript
// routes/hello/route.ts
import { createRoute } from "koritsu";
import { z } from "zod";

export const GET = createRoute({
  method: "GET",
  handler: async () => {
    return Response.json({ message: "Hello, world!" });
  },
  spec: {
    format: "json",
    summary: "Hello World",
    responses: {
      200: {
        schema: z.object({
          message: z.string(),
        }),
      },
    },
  },
});
  1. Run the server
bash
bun run index.ts

Visit http://localhost:8080 to see your API documentation!