A template for deploying a Bun + Hono API, production ready with bun binary compilation.
- Bun JavaScript Runtime
- Hono Web Framework
- Binary compilation for production
- Logger Middleware
- CORS Support
- TypeScript
# Install dependencies
bun install
# Start development server with hot reload
bun run dev
# Build the binary
bun run build
# Run the compiled binary
./server
# Build the image (includes binary compilation)
docker build -t bun-hono-api .
# Run the container
docker run -p 3000:3000 bun-hono-api
The template is configured to automatically:
- Build the binary during Docker build stage
- Run the optimized binary in production
GET /
- Welcome messageGET /health
- Health check endpointGET /users
- User homeGET /users/profile
- User profile endpoint
PORT
- Server port (default: 3000)NODE_ENV
- Environment mode (development/production)
In development:
- Uses hot reload
- Detailed error messages
- CORS allows all origins
In production:
- Runs compiled binary
- Limited error information
- Configured CORS
- Optimized for performance