From 4f75a03b48600cdb322ea4844b020795c7f19880 Mon Sep 17 00:00:00 2001 From: Outvi V <19144373+outloudvi@users.noreply.github.com> Date: Sun, 10 Oct 2021 17:00:14 +0800 Subject: [PATCH] feat: add Worktop webhook support (#43) --- deno/src/convenience/webhook.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/deno/src/convenience/webhook.ts b/deno/src/convenience/webhook.ts index 19f9b227..2a3e8211 100644 --- a/deno/src/convenience/webhook.ts +++ b/deno/src/convenience/webhook.ts @@ -16,6 +16,7 @@ type SupportedFrameworks = | 'koa' | 'oak' | 'fastify' + | 'worktop' /** * Abstraction over a request-response cycle, provding access to the update, as @@ -72,6 +73,11 @@ const frameworkAdapters: Record = { update: Promise.resolve(req.body), respond: json => reply.send(json), }), + worktop: (req, res) => ({ + update: Promise.resolve(req.body.json()), + end: () => res.end(), + respond: json => res.send(200, json) + }) // please open a PR if you want to add another }