> ## Documentation Index
> Fetch the complete documentation index at: https://bun.zhcndoc.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 使用 Hono 和 Bun 构建 HTTP 服务器

[Hono](https://github.com/honojs/hono) 是一个为边缘计算设计的轻量级超快 Web 框架。

```ts server.ts icon="https://mintcdn.com/bun-zhcndoc/cnUTwgMuf4cCrwC-/icons/typescript.svg?fit=max&auto=format&n=cnUTwgMuf4cCrwC-&q=85&s=e7767043c9e885c34f2d6c8fe2a95217" theme={"theme":{"light":"github-light","dark":"dracula"}}
import { Hono } from "hono";
const app = new Hono();

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

export default app;
```

***

使用 `create-hono` 从 Hono 的项目模板开始。提示选择模板时请选择 `bun`。

```sh terminal icon="terminal" theme={"theme":{"light":"github-light","dark":"dracula"}}
bun create hono myapp
```

```txt theme={"theme":{"light":"github-light","dark":"dracula"}}
✔ 你想使用哪个模板？ › bun
已克隆 honojs/starter#main 到 /path/to/myapp
✔ 已复制项目文件
```

```sh terminal icon="terminal" theme={"theme":{"light":"github-light","dark":"dracula"}}
cd myapp
bun install
```

***

然后启动开发服务器并访问 [localhost:3000](http://localhost:3000)。

```sh terminal icon="terminal" theme={"theme":{"light":"github-light","dark":"dracula"}}
bun run dev
```

***

有关更多信息，请参阅 Hono 的关于 [使用 Bun 入门](https://hono.dev/getting-started/bun) 指南。
