UNPKG

@worker-tools/middleware

Version:

A suite of standalone HTTP server middlewares for Worker Runtimes.

18 lines (17 loc) 520 B
import type { Awaitable } from "./utils/common-types.js"; import type { Context } from "./index.js"; import type { Method } from "./cors.js"; export interface BasicsContext { request: Request; headers: Headers; url: URL; method: Method; pathname: string; searchParams: URLSearchParams; userAgent: string; params: { [key: string]: string | undefined; }; ip?: string; } export declare const basics: () => <X extends Context>(ax: Awaitable<X>) => Promise<X & BasicsContext>;