Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/workers_middleware/context.ts>FetchEvent

Placeholder for Worker-based middleware solution
Latest
interface FetchEvent
implements ExtendableEvent
import { type FetchEvent } from "https://deno.land/x/workers_middleware@v0.1.0-pre.36/context.ts";

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.

Properties

readonly
clientId: string
readonly
preloadResponse: Promise<any>
readonly
replacesClientId: string
readonly
request: Request
readonly
resultingClientId: string
readonly
handled: Promise<void>

Methods

respondWith(r: Response | Promise<Response>): void