Skip to main content
Module

x/workers_middleware/context.ts

Placeholder for Worker-based middleware solution
Latest
import * as workersMiddleware from "https://deno.land/x/workers_middleware@v0.1.0-pre.36/context.ts";

Functions

Type-enforcing left-to-right function composition function. The first parameter can be a function of any arity, but the remaining parameters must be unary functions. The return type of one function must be compatible with the argument of next function in the argument list (i.e. types flow from left-to-right)

A helper function to create user-defined middleware.

f
executeEffects
deprecated
f
withMiddleware
deprecated

Takes a handler function of the form (x: Request, ctx: Context) => Awaitable<Response> and applies middleware to it.

Interfaces

Extends the lifetime of the install and activate events dispatched on the global scope as part of the service worker lifecycle. This ensures that any functional events (like FetchEvent) are not dispatched until it upgrades database schemas and deletes the outdated cache entries.

This is the event type for fetch events dispatched on the service worker global scope. It contains information about the fetch, including the request and how the receiver will treat the response. It provides the event.respondWith() method, which allows us to provide a response to this fetch.

Type Aliases

Helper type to get the context type of a given middleware function.

T
ErrorContext
deprecated
T
ErrorHandler
deprecated
T
Handler
deprecated
T
Middleware
deprecated

Any record of unknown values