Bun

指南生態系統

使用 Hono 和 Bun 建立 HTTP 伺服器

Hono 是一個輕量級、超快速的 Web 框架,專為邊緣運算設計。

import { Hono } from "hono";
const app = new Hono();

app.get("/", c => c.text("Hono!"));

export default app;

使用 create-hono 開始使用 Hono 的專案範本之一。當提示選擇範本時,請選擇 bun

bun create hono myapp
✔ Which template do you want to use? › bun
cloned honojs/starter#main to /path/to/myapp
✔ Copied project files
cd myapp
bun install

然後啟動開發伺服器並訪問 localhost:3000

bun run dev

請參閱 Hono 的 Bun 入門指南 以獲取更多資訊。