Key Difference: The main setup difference is that you need to copy all
variables from
server/.env to web/.env for NextAPI configurations, and the
bundler differs between Bun and Node.js.Configuration Options
Key Differences
Environment Variables Setup
Important: For NextAPI configurations (NextAPI + Node, NextAPI + Bun), you
need to copy all variables from
server/.env to web/.env. This is because
the API routes run within the Next.js application.Bundler Differences
| Configuration | Bundler | Performance | Bundle Size |
|---|---|---|---|
| Hono + Bun | Bun bundler | ⭐⭐⭐⭐⭐ | Small |
| NextAPI + Node | Webpack | ⭐⭐⭐ | Medium |
| Hono + Node | Webpack/esbuild | ⭐⭐⭐⭐ | Small |
| NextAPI + Bun | Bun bundler | ⭐⭐⭐⭐⭐ | Small |
Runtime Performance
| Configuration | Startup Time | Memory Usage | Cold Start |
|---|---|---|---|
| Hono + Bun | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ |
| NextAPI + Node | ⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐ |
| Hono + Node | ⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐⭐ |
| NextAPI + Bun | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ |
Choosing Your Configuration
Choose Hono + Bun (Default) if:
- You want the fastest performance
- You’re building a new project
- You prefer modern, lightweight frameworks
- You want excellent developer experience
Choose NextAPI + Node if:
- You’re familiar with Next.js API routes
- You need extensive Node.js ecosystem compatibility
- You prefer traditional webpack bundling
- You’re migrating from existing Next.js projects
Choose Hono + Node if:
- You want Hono’s lightweight framework
- You need Node.js ecosystem compatibility
- You prefer traditional deployment methods
- You want good performance with familiar tooling
Choose NextAPI + Bun if:
- You want Next.js API routes with Bun’s performance
- You’re building a new project with Next.js
- You want the best of both worlds
- You prefer Bun’s bundler but want Next.js structure
Next Steps
Select your preferred configuration and follow the specific setup guide:- Hono + Bun Setup Guide (Default)
- NextAPI + Node Setup Guide
- Hono + Node Setup Guide
- NextAPI + Bun Setup Guide