Build an HTTP server using Hono and Bun
Hono is a lightweight web framework designed for the edge.
server.ts
import { Hono } from "hono";
const app = new Hono();
app.get("/", c => c.text("Hono!"));
export default app;Use create-hono to get started with one of Hono's project templates. Select bun when prompted for a template.
terminal
bun create hono myappcreate-hono version 0.19.4
✔ Using target directory … myapp
✔ Which template do you want to use? bun
✔ Do you want to install project dependencies? Yes
✔ Which package manager do you want to use? bun
✔ Cloning the template
✔ Installing project dependencies
🎉 Copied project files
Get started with: cd myappterminal
cd myapp
bun installThen start the dev server and visit localhost:3000.
terminal
bun run devRefer to Hono's getting started with Bun guide.