🚀 File-based Routing
Routes are auto-discovered from your filesystem structure. Simply create a route.ts file and your endpoint is ready.
Built with Bun, featuring automatic OpenAPI documentation generation
bun install koritsu// index.ts
import { Api } from "koritsu";
new Api({
server: {
routes: {
dir: "./routes", // Directory containing your route files
},
},
}).start();// 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(),
}),
},
},
},
});bun run index.tsVisit http://localhost:8080 to see your API documentation!