1
0

make cf ctx optional

This commit is contained in:
2022-11-28 21:27:25 +01:00
parent 5e18d06dfd
commit 2a064dcb9c

View File

@@ -23,7 +23,7 @@ export interface Route<TEnv> {
export interface RouterContext<TEnv = any> {
env: TEnv
req: RouterRequest
ctx: ExecutionContext
ctx?: ExecutionContext
}
/**
@@ -376,7 +376,7 @@ export class Router<TEnv = any> {
* @param {any} [extend]
* @returns {Promise<Response>}
*/
public async handle(request: Request, env: TEnv, ctx: ExecutionContext, extend: any = {}): Promise<Response> {
public async handle(request: Request, env: TEnv, ctx?: ExecutionContext, extend: any = {}): Promise<Response> {
const req: RouterRequest = {
...extend,
method: request.method,