Appearance
Web 标准
🌐 Web Standards
Hono 仅使用 Web 标准,如 Fetch。它们最初用于 fetch 函数,并由处理 HTTP 请求和响应的基本对象组成。除了 Requests 和 Responses,还有 URL、URLSearchParam、Headers 等。
🌐 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 are built 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 计算
- AWS Lambda
- Node.js
- Vercel (edge-light)
- WebAssembly(通过
wasi:http使用 WebAssembly 系统接口 (WASI))
它也可以在 Netlify 和其他平台上运行。相同的代码可以在所有平台上运行。
🌐 It also works on Netlify and other platforms. The same code runs on all platforms.
Cloudflare Workers、Deno、Shopify 以及其他公司启动了 WinterCG,以讨论使用 Web 标准实现“网页互操作性”的可能性。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.