Create a New Project
The fastest way to get started is using thecreate-hono scaffolding tool:
Create your project
Run the scaffolding command to create a new Hono project:You’ll be prompted to:
- Enter a project name
- Choose a template (cloudflare-workers, deno, bun, nodejs, etc.)
- Select whether to install dependencies
Your First Hono App
Here’s a simple “Hello World” example that demonstrates the core concepts:index.ts
- Import: Bring in the
Honoclass from thehonopackage - Create: Instantiate a new Hono application
- Route: Define a GET route at the root path
- Handler: Return a text response using the context object
c - Export: Make the app available to the runtime
Add More Routes
Expand your app with different HTTP methods and dynamic routes:Working with Different Runtimes
One of Hono’s superpowers is that the same code runs on multiple platforms. Here’s how to run your app on different runtimes:- Cloudflare Workers
- Bun
- Deno
- Node.js
Response Types
Hono’s context object provides convenient methods for different response types:Next Steps
Now that you have a basic Hono app running, explore more features:Routing
Learn about path parameters, wildcards, and route grouping
Middleware
Add authentication, CORS, logging, and more
Context
Master the request and response handling
Validation
Validate request data with type safety