Skip to content

Web 标准

¥Web Standards

Hono 仅使用 Fetch 等 Web 标准。它们最初用于 fetch 函数,由处理 HTTP 请求和响应的基本对象组成。除了 RequestsResponses,还有 URLURLSearchParamHeaders 等。

¥Hono uses only Web Standards like Fetch. They were originally used in the fetch function and consist of basic objects that handle HTTP requests and responses. In addition to Requests and Responses, there are URL, URLSearchParam, Headers and others.

Cloudflare Workers、Deno 和 Bun 也基于 Web 标准构建。例如,返回 "Hello World" 的服务器可以按如下方式编写。这可以在 Cloudflare Workers 和 Bun 上运行。

¥Cloudflare Workers, Deno, and Bun also build upon Web Standards. For example, a server that returns "Hello World" could be written as below. This could run on Cloudflare Workers and Bun.

ts
export default {
  async 
fetch
() {
return new
Response
('Hello World')
}, }

Hono 仅使用 Web 标准,这意味着 Hono 可以在支持它们的任何运行时上运行。此外,我们还有一个 Node.js 适配器。Hono 在这些运行时上运行:

¥Hono uses only Web Standards, which means that Hono can run on any runtime that supports them. In addition, we have a Node.js adapter. Hono runs on these runtimes:

  • Cloudflare Workers (workerd)

  • Deno

  • Bun

  • Fastly 计算

    ¥Fastly Compute

  • AWS Lambda

  • Node.js

  • Vercel (edge-light)

它也适用于 Netlify 和其他平台。相同的代码在所有平台上运行。

¥It also works on Netlify and other platforms. The same code runs on all platforms.

Cloudflare Workers、Deno、Shopify 和其他公司推出了 WinterCG,以讨论使用 Web 标准启用 "web-interoperability" 的可能性。Hono 将遵循他们的步骤并采用 Web 标准的标准。

¥Cloudflare Workers, Deno, Shopify, and others launched WinterCG to discuss the possibility of using the Web Standards to enable "web-interoperability". Hono will follow their steps and go for the Standard of the Web Standards.

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