Context
import type { Context } from "https://raw.githubusercontent.com/worker-tools/middleware/master/index.ts";
interface Context {
args?: any[];
connInfo?: any;
ctx?: any;
effects: AppendOnlyList<ResponseEffect>;
env?: any;
event?: FetchEvent;
handled: Promise<Response>;
match?: URLPatternResult;
request: Request;
waitUntil: (f: any) => void;
}§Properties
§
effects: AppendOnlyList<ResponseEffect>
[src]A list of effects/transforms applied to the Response
after the application handler completes.
Middleware can add effects to the list. Application handlers should ignore it.
§
event?: FetchEvent
[src]Only available if the router is used via fetchEventListener
.
Many Worker Runtimes such as Deno an CF module workers don't provide fetch events.
§
handled: Promise<Response>
[src]A promise that resolves when middleware is done applying effects. Related: https://github.com/w3c/ServiceWorker/issues/1397
§
match?: URLPatternResult
[src]The URL pattern match that caused this handler to run. See the URL Pattern API for more.