Skip to main content

MiddlewareFetch

Overview

Usage

import { MiddlewareFetch } from 'keywork/router/interfaces'

Type parameters

NameTypeDescription
BoundAliases{}The bound aliases, usually defined in your wrangler.toml file.
ExpectedReturnextends MiddlewareReturnTypes = Promise<Response>-

Callable

MiddlewareFetch

MiddlewareFetch

(request?, env?, eventLike?, next?, matchedRoutes?): `ExpectedReturn`

Middleware implementation of fetch

This type is similar to typeof fetch with the option to return null to fallthrough.

Parameters

NameTypeDescription
request?Request-
env?BoundAliases-
eventLike?unknownSee - -
next?(...args: [request?: Request, env?: BoundAliases, eventLike?: unknown, next?: ((request?: Requestundefined, env?: BoundAliases
matchedRoutes?RouteMatch<any>[]-

Returns

ExpectedReturn

Defined in

router/interfaces/MiddlewareFetch.ts:44