From 72284505a043d175fc96abec57b6ffb1192e325c Mon Sep 17 00:00:00 2001 From: Michael Wolf Date: Fri, 7 Mar 2025 21:29:38 -0600 Subject: [PATCH] Teach handler to accept various methods --- deno/routes.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deno/routes.ts b/deno/routes.ts index 85f0f48..cd3047a 100644 --- a/deno/routes.ts +++ b/deno/routes.ts @@ -61,14 +61,14 @@ const routes: Route[] = [ }, { path: "/ok", - methods: ["GET"], - handler: (_req: Request) => { + methods: ["GET", "POST", "PUT"], + handler: (req: Request) => { const code = httpCodes.success.OK; const rn = services.random.randomNumber(); return { code, - result: "it is ok " + rn, + result: `that was ${req.method} (${rn})`, contentType: contentTypes.text.plain, }; },