Skip to main content
Module

x/shed/middleware.ts>Context

All Worker Tools under a single roof
Latest
interface Context
Re-export
import { type Context } from "https://deno.land/x/shed@v0.1.0-pre.10/middleware.ts";

Properties

request: Request

The original request for use in middleware. Also accessible via first argument to user handler.

deprecated
effects: AppendOnlyList<ResponseEffect>

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.

waitUntil: (f: any) => void

TODO

handled: Promise<Response>

A promise that resolves when middleware is done applying effects. Related: https://github.com/w3c/ServiceWorker/issues/1397

optional
match: URLPatternResult

The URL pattern match that caused this handler to run. See the URL Pattern API for more.

optional
event: FetchEvent

Only available if the router is used via fetchEventListener. Many Worker Runtimes such as Deno an CF module workers don't provide fetch events.

optional
env: any

Might be present based on usage

optional
ctx: any

Might be present based on usage

optional
connInfo: any

Might be present based on usage

optional
args: any[]

Might be present based on usage