Comments (4)
Deno support is currently an issue for all Octokit modules.
We can try to fix some bugs and get some functionality working, but the proper solution will be when we rewrite all the modules as ESM native.
from webhooks.js.
Gotcha, I ended up making it somewhat work with:
import { createEventHandler } from "https://esm.sh/@octokit/[email protected]";
import { serve } from "https://deno.land/[email protected]/http/server.ts";
const secret = "mysecret";
const eventHandler = createEventHandler({ secret });
eventHandler.onAny(({ id, name, payload }) => {
console.log(name, "event received");
});
serve(async (req: Request) => {
if (req.url.endsWith("/webhooks")) {
eventHandler.receive({
id: req.headers.get("x-github-delivery"),
name: req.headers.get("x-github-event"),
payload: await req.json(),
});
return Response.json({
message:
"Triggered webhook",
});
} else {
return Response.json({ status: "OK" });
}
}, { port: 3000 });
from webhooks.js.
I know this issue has been closed, but currently createNodeMiddleware()
cannot be used in Deno because the Deno core team don't want to support setTimeout()
returning an object. Would you be amenable to a small patch that removed the use of setTimeout().unref()
so that createNodeMiddleware()
worked in Deno?
from webhooks.js.
Would you be amenable to a small patch that removed the use of
setTimeout().unref()
so thatcreateNodeMiddleware()
worked in Deno?
sure! I don't see a disadvantage. I hope I don't miss anything 😬
Longer term we want to move the create*Middleware
into dedicated packages, as they introduce lots of dependencies and are often times not universal, like in this case.
from webhooks.js.
Related Issues (20)
- [BUG]: Express middleware aborts on non-POST requests in v11 HOT 12
- How to disable secret verification? HOT 3
- [FEAT]: Add support for deployment_protection_rule event HOT 2
- [FEAT]: Export type MiddlewareOptions
- [FEAT]: request to export event handler parameter type HOT 7
- [BUG]: signature does not match event payload and secret HOT 4
- [DOCS]: Smee setup documentation has an error HOT 3
- The automated release is failing 🚨 HOT 1
- Avoid parsing JSON payload twice. HOT 4
- Memory leak/recursive loop in 12.0.7 in the types HOT 6
- [FEAT]: Export createNodeHandler HOT 11
- [BUG]: google-cloud-function, can not verify payload HOT 4
- [BUG]: bodyparser in get-payload potentially buggy HOT 2
- [MAINT]: Investigate performance loss due to data conversions HOT 8
- [BUG]: Current documentation still refers to outdated 'path' in Middleware options instead of the new `pathPrefix` HOT 5
- [BUG]: Preparsed payloads are not handled correctly, here Vercel HOT 4
- [BUG]: Type discrepencies vs actual code HOT 3
- [BUG]: webhooks.js v12.0.10 onward breaks compatibility with @fastify/middie middleware library HOT 4
- [MAINT]: drop aggregate-error dependency HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webhooks.js.