Teach handler to accept various methods

This commit is contained in:
Michael Wolf
2025-03-07 21:29:38 -06:00
parent ecdbedc135
commit 72284505a0

View File

@@ -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,
};
},