-
Notifications
You must be signed in to change notification settings - Fork 82
Description
What’s missing?
For better consistency with other modules (compare https://github.com/octokit/app.js/, https://github.com/octokit/oauth-app.js/), better compatibility with browsers, and better composability, we should
- Export a
createNodeMiddleware(app, { path })function - Deprecate
webhooks.middlewareand thepathconstuctor option - Default the webhooks path to
/api/github/webhooks, for better compatibility with the defaults of https://github.com/octokit/oauth-app.js#createnodemiddlewareapp-options
Why?
http request routing is not a concern of the @octokit/webhooks library. When it was created, long-living node processes were the norm. Today, serverless enviroments gain more and more traction, and they come with their own http routing. Moving it out of the core library will make it easier to use in serverless environments, and easier to compose with other libraries, such as https://github.com/octokit/app.js/, https://github.com/octokit/octokit.js, and github.com/probot/probot/
Alternatives you tried
It's possible to use & compose the library as is today, but it's unnecessary complicated.