Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/keywork/events/classes/IsomorphicFetchEvent.ts>IsomorphicFetchEvent

A library for building V8 Isolate web apps on Cloudflare Workers, Deno, and Node.JS
Go to Latest
class IsomorphicFetchEvent
import { IsomorphicFetchEvent } from "https://deno.land/x/keywork@v6.0.1/events/classes/IsomorphicFetchEvent.ts";

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

Generally, this interface is exclusive to KeyworkRouter#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 KeyworkRouter.

Caveats

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

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