Modules
The pieces that do the work, composed from Standard and Core. This is the layer an application imports from.
Exports
| Export | Kind | Import from | Documented in |
|---|---|---|---|
Application | class | modules/http.native.js / .polyfill.js | Application |
Resource | class | modules/http.native.js / .polyfill.js | Resource |
Middleware | class | modules/http.native.js / .polyfill.js | Middleware |
ResourceGroup | class | modules/http.native.js / .polyfill.js | Resource groups |
HTTPError | class | modules/http.native.js / .polyfill.js | HTTPError |
HTTPRequest | type | modules/http.native.js / .polyfill.js | HTTP |
requestChain | function | modules/builders/RequestChainBuilder.js | RequestChainBuilder |
request | function | modules/builders/RequestBuilder.js | RequestBuilder |
response | function | modules/builders/ResponseBuilder.js | ResponseBuilder |
ResponseBuilder | class | modules/builders/ResponseBuilder.js | ResponseBuilder |
AcceptHeader | function | modules/middleware/AcceptHeader.js | AcceptHeader |
CORS | function | modules/middleware/CORS.js | CORS |
ETag | function | modules/middleware/ETag.js | ETag |
RateLimiter | function | modules/middleware/RateLimiter.js | RateLimiter |
Each pre-built middleware also exports its XMiddleware class, its Options type, and its defaultOptions — see the individual pages.
The Two Entry Points
modules/http.native.js and modules/http.polyfill.js export the same members. The only difference is which URLPattern implementation they use under the hood.
| Entry point | For |
|---|---|
modules/http.native.js | Deno, Cloudflare Workers |
modules/http.polyfill.js | Node, Bun |
See Native vs. Polyfill.
Any change to one entry point has to be mirrored in the other. They are separate files with the same surface, and the compat tests exist in native/ and polyfill/ pairs for that reason.
Sections
Last updated on