Skip to main content
Module

x/shed/index.ts>WorkerRouter#external

All Worker Tools under a single roof
Latest
method WorkerRouter.prototype.external
import { WorkerRouter } from "https://deno.land/x/shed@v0.1.0-pre.10/index.ts";

Add a route that matches any method with the provided pattern. Note that the pattern here is interpreted as a URLPatternInit which has important implication for matching. Mostly, this is for use in Service Workers to intercept requests to external resources.

The name external is a bit of a misnomer. It simply forwards init to the URLPattern constructor, instead of being limited to the pathname property in the general case.

Type Parameters

X extends RX

Parameters

init: string | URLPatternInit
handler: Handler<X>

Type Parameters

X extends RX

Parameters

init: string | URLPatternInit
middleware: Middleware<RX, X>
handler: Handler<X>