Hono
Hono is an ultra-fast, edge-first web framework for building APIs and web services with TypeScript.
Presentation
Production-ready Hono API server with middleware (CORS, logger, timeout), error handling, health check endpoint, and optional AWS Lambda deployment.
What create-faster adds
Beyond the official setup, we include:
Pre-configured Middleware:
- Logger middleware for request logging
- Timeout middleware (15s default)
- CORS middleware with wildcard origin and standard headers
- Zod validator for request validation
API Structure:
- Health check endpoint (
/health/:id) with JSON response - Global error handler with dev/prod stack trace control
- 404 not found handler with JSON response
- Separation of concerns:
app.ts(routes) andindex.ts(entry point)
Development Scripts:
dev- Watch mode with hot reload (bun run --watch)start- Production serverbuild- Compile to single ESM file with Bun
Error Handling:
- Global error handler with stack traces in development
- Structured JSON error responses
- Console logging for debugging
Files created:
src/
├── app.ts # Hono app with routes and middleware
├── index.ts # Entry point (AWS Lambda or Node.js)
└── ...
package.json # Dependencies and scripts
tsconfig.json # TypeScript configurationDependencies:
hono- Core framework@hono/node-server- Node.js adapter@hono/zod-validator- Zod validation middleware
Integration notes:
- ORM integration: When Drizzle or Prisma is selected, database packages are included
- Turborepo: Uses
@repo/dbpackage for shared database logic - Single repo: Includes database dependencies directly
Modules
AWS Lambda
Technical changes:
Modified files:
src/index.ts- Conditionally exports Lambda handler instead of raw app
When enabled:
import { handle } from 'hono/aws-lambda';
import app from './app';
export const handler = handle(app); // Lambda entry pointWhen disabled:
import app from './app';
export default app; // Standard Node.js serverWhat it does:
- Imports
handleadapter fromhono/aws-lambda - Wraps Hono app in Lambda-compatible handler
- Transforms Lambda events → Hono requests
- Transforms Hono responses → Lambda responses
Deployment:
- Use this module when deploying to AWS Lambda
- The
handlerexport is the Lambda function entry point - No additional configuration files needed

