BurgerAPI
A modern, open source Bun.js native framework with file-based routing, middleware support, Zod validation, and automatic OpenAPI generation.
// Step 1: Import the necessary modulesimport { Burger } from 'burger-api';// Step 2: Create and configure your API serverconst burger = new Burger({apiDir: "api", // Where your API routes are});// Step 3: Start the server on port 4000burger.serve(4000);
🚀 Features
Bun-Native Performance
Utilizes Bun's high-performance HTTP server to provide rapid API responses also use others Bun's native APIs for outstanding speed and efficiency.
File-Based Routing
Automatically registers APIs and static pages routes from your file structure using a clear naming convention. Supports dynamic routes via folder names like [id] for /api/product/:id.
Middleware Architecture
Supports global and route-specific middleware with flexible response handling - continue, short-circuit, or modify responses.
Type-Safe Validation
Utilizes Zod for request validation, ensuring full type safety and automatic error reporting. Validates request params, query, and body with support for preprocessing.
Automatic OpenAPI Generation
Generates a complete OpenAPI 3.0 specification directly from your routes and Zod schemas. Includes support for tags, summaries, descriptions, and more.
Swagger UI Integration
Provides an out-of-the-box Swagger UI endpoint for interactive API documentation. Access your API documentation at /docs with a fully interactive interface.