Skip to content

理念

🌐 Philosophy

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

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

动机

🌐 Motivation

起初,我只是想在 Cloudflare Workers 上创建一个网页应用。但没有适用于 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”。我还有一个朋友创建了基本认证中间件。

🌐 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 中文网 - 粤ICP备13048890号