Skip to main content
Module

x/keywork/mod.ts>Events.IsomorphicFetchEvent

A library for building V8 Isolate web apps on Cloudflare Workers, Deno, and Node.JS
Go to Latest
class Events.IsomorphicFetchEvent
extends AbstractFetchEvent
import { Events } from "https://deno.land/x/keywork@v6.2.0/mod.ts";
const { IsomorphicFetchEvent } = Events;

An event object containing contextual data for a single and specific incoming HTTP request.

Generally, this interface is exclusive to RequestRouter#fetch and automatically passed to your subclass's route handlers.

This is similar to EventContext defined in the @cloudflare/workers-types package. However, the IsomorphicFetchEvent type includes additional information from RequestRouter.

Caveats

  • The request.url property will be updated by route handler of RequestRouter.

Constructors

new
IsomorphicFetchEvent(eventInit: IsomorphicFetchEventInit<BoundAliases, Data>)

Type Parameters

optional
BoundAliases = { }
optional
ExpectedParams = { }
optional
Data extends { } = { }

Properties

data: Data

Optional extra data to be passed to a route handler, usually from Keywork#Middleware | middleware.

readonly
env: BoundAliases

The bound environment aliases.

Cloudflare Workers

These are usually defined in your wrangler.toml file.

Node.js

This is similar to process.env.

optional
match: URLPatternResult

URL Patterns matched.

readonly
params: ExpectedParams

The names and values of dynamic parameters in the URL. Parameters are parsed using the incoming request's URL and the route's pattern.

Static Methods

assertIsInstanceOf(eventLike: unknown): eventLike is IsomorphicFetchEvent

Checks if the given object is an instance of IsomorphicFetchEvent