From 9c259d7cf88548a99b084e7d2105c04b7468a973 Mon Sep 17 00:00:00 2001 From: krutoo Date: Fri, 5 Apr 2024 14:25:45 +0500 Subject: [PATCH] route-all - `server`: `route.all` method added - `server`: `route.patch` method added --- src/server.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/server.ts b/src/server.ts index 93a741a..6bc9eeb 100644 --- a/src/server.ts +++ b/src/server.ts @@ -35,6 +35,7 @@ export function route(pattern: RoutePattern, handler: Handler): Route { }; } +route.all = route; // for express compatibility route.get = createRouteFactoryForMethod('get'); route.post = createRouteFactoryForMethod('post'); route.put = createRouteFactoryForMethod('put'); @@ -42,6 +43,7 @@ route.delete = createRouteFactoryForMethod('delete'); route.head = createRouteFactoryForMethod('head'); route.options = createRouteFactoryForMethod('options'); route.connect = createRouteFactoryForMethod('connect'); +route.patch = createRouteFactoryForMethod('patch'); function createRouteFactoryForMethod(method: string) { const isSuitableMethod = (request: Request) => request.method.toLowerCase() === method;