Skip to content

理念

¥Philosophy

在本节中,我们将讨论 Hono 的概念或哲学。

¥In this section, we talk about the concept, or philosophy, of Hono.

动机

¥Motivation

起初,我只是想在 Cloudflare Workers 上创建一个 Web 应用。但是,没有适用于 Cloudflare Workers 的好框架。所以,我开始构建 Hono。

¥At first, I just wanted to create a web application on Cloudflare Workers. But, there was no good framework that works on Cloudflare Workers. So, I started building Hono.

我认为这是一个学习如何使用 Trie 树构建路由的好机会。然后一个朋友出现了,他带来了名为 "RegExpRouter" 的超快路由。我还有一个朋友创建了 Basic 身份验证中间件。

¥I thought it would be a good opportunity to learn how to build a router using Trie trees. Then a friend showed up with ultra crazy fast router called "RegExpRouter". And I also have a friend who created the Basic authentication middleware.

仅使用 Web 标准 API,我们就可以使其在 Deno 和 Bun 上运行。当人们问 "Bun 有 Express 吗?" 时,我们可以回答 "没有,但是有 Hono"。(尽管 Express 现在可以在 Bun 上运行。)

¥Using only Web Standard APIs, we could make it work on Deno and Bun. When people asked "is there Express for Bun?", we could answer, "no, but there is Hono". (Although Express works on Bun now.)

我们也有朋友制作 GraphQL 服务器、Firebase 身份验证和 Sentry 中间件。我们还有一个 Node.js 适配器。一个生态系统已经出现。

¥We also have friends who make GraphQL servers, Firebase authentication, and Sentry middleware. And, we also have a Node.js adapter. An ecosystem has sprung up.

换句话说,Hono 速度非常快,使很多事情成为可能,并且可以在任何地方工作。我们可以想象 Hono 可以成为 Web 标准的标准。

¥In other words, Hono is damn fast, makes a lot of things possible, and works anywhere. We might imagine that Hono could become the Standard for Web Standards.

Hono v4.7 中文网 - 粤ICP备13048890号