fixes handlers not being compatible with deno handlers
This commit is contained in:
@@ -6,7 +6,7 @@ interface RouterContext {
|
||||
request: Request;
|
||||
}
|
||||
|
||||
type Handler = (ctx: RouterContext) => Promise<Response> | Response;
|
||||
type Handler = (req: Request, ctx: RouterContext) => Promise<Response> | Response;
|
||||
type Middleware = (ctx: RouterContext, next: () => Promise<Response>) => Promise<Response>;
|
||||
|
||||
interface RouteConfig {
|
||||
@@ -247,7 +247,7 @@ export class Router {
|
||||
return await middleware.handler(middlewareCtx, executeMiddleware);
|
||||
}
|
||||
// Final handler gets the accumulated parameters
|
||||
return await handler(baseCtx);
|
||||
return await handler(req, baseCtx);
|
||||
};
|
||||
|
||||
try {
|
||||
|
Reference in New Issue
Block a user