Teach handler to accept various methods
This commit is contained in:
@@ -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,
|
||||
};
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user