> ## Documentation Index
> Fetch the complete documentation index at: https://bun.ll1025.cn/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/span-inc/82N53aP7NFbaCVSl/icons/typescript.svg?fit=max&auto=format&n=82N53aP7NFbaCVSl&q=85&s=787d39d6a7d96d7f9540dc74344eba23" theme={null}
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={null}
bun create hono myapp
```

```txt theme={null}
✔ 你想使用哪个模板？ › bun
已从 honojs/starter#main 克隆到 /path/to/myapp
✔ 项目文件已复制
```

```sh terminal icon="terminal" theme={null}
cd myapp
bun install
```

***

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

```sh terminal icon="terminal" theme={null}
bun run dev
```

***

参考 Hono 的[Bun 入门指南](https://hono.dev/getting-started/bun)。
