MiddlewareFetch
Overview
Usage
- Node
- Deno
import { MiddlewareFetch } from 'keywork/router/interfaces'
import { MiddlewareFetch } from 'https://deno.land/x/keywork/router/interfaces'
Type parameters
Name | Type | Description |
---|---|---|
BoundAliases | {} | The bound aliases, usually defined in your wrangler.toml file. |
ExpectedReturn | extends MiddlewareReturnTypes = Promise<Response> | - |
Callable
MiddlewareFetch
MiddlewareFetch
(request?, env?, eventLike?, next?, matchedRoutes?): `ExpectedReturn`
Parameters
Name | Type | Description |
---|---|---|
request? | Request | - |
env? | BoundAliases | - |
eventLike? | unknown | See - - |
next? | (...args : [request?: Request, env?: BoundAliases, eventLike?: unknown, next?: ((request?: Request | undefined, env?: BoundAliases |
matchedRoutes? | RouteMatch<any> [] | - |
Returns
ExpectedReturn
Defined in
router/interfaces/MiddlewareFetch.ts:44
Middleware implementation of
fetch
This type is similar to
typeof fetch
with the option to returnnull
to fallthrough.