网页 综合 更新时间 2026-11-14 09:26:33

@rabbit-company/web - JSR

自动蜘蛛 jsr.io 正文约 1690 字
@rabbit-company/web - JSR
High-performance web framework
A high-performance web framework built for Bun, Deno, NodeJS and Cloudflare Workers with trie-based routing, middleware support, and TypeScript-first design. ⚡
Middleware runs for WebSocket upgrades just like for HTTP requests, so the same bearerAuth, rateLimit or ipRestriction that protects your routes also protects your WebSocket endpoints. The connection is only upgraded when every matching middleware calls next(). A middleware that responds instead (for example with 401), or throws, refuses the upgrade.
Bun 1.4+ can serve HTTP/2 and HTTP/3 next to HTTP/1.1 from the same listen() call. Routes, middleware, request bodies and ctx.clientIp behave identically on every protocol. Both are experimental in Bun, so don't enable HTTP/3 in production yet.
Always return the result of next() (or the response you built from it). A middleware that only does await next() hands undefined to every middleware registered before it, so they cannot read or change the response.
Middleware paths (use()) match the same way as routes (get(), post(), ...): "/admin" matches only /admin itself, not /admin/users. End the path with /* to cover a path and everything below it:
Use /* for authentication, rate limiting and other middleware that should protect a whole section of your app.
Benchmarks against popular frameworks:
Tested on Framework 16 laptop (Ryzen 7040 Series)
This project is licensed under the MIT License - see the LICENSE file for details. 🐇💕
Please provide a reason for reporting this package. We will review your report and take appropriate action.
Please review the JSR usage policy before submitting a report.
Import directly with a jsr specifier
访问原文 返回搜索 https://jsr.io/@rabbit-company/web
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。