Skip to content

Commit

Permalink
feat: add Worktop webhook support (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
outloudvi committed Oct 10, 2021
1 parent 2bfd0e3 commit 4f75a03
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions deno/src/convenience/webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ type SupportedFrameworks =
| 'koa'
| 'oak'
| 'fastify'
| 'worktop'

/**
* Abstraction over a request-response cycle, provding access to the update, as
Expand Down Expand Up @@ -72,6 +73,11 @@ const frameworkAdapters: Record<SupportedFrameworks, FrameworkAdapter> = {
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
}

Expand Down

0 comments on commit 4f75a03

Please sign in to comment.