Skip to content

Commit

Permalink
docs: add webhooksPath option for createNodeMiddleware (#1588)
Browse files Browse the repository at this point in the history
  • Loading branch information
maximousblk committed Aug 31, 2021
1 parent 803fa2f commit 624b934
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
11 changes: 5 additions & 6 deletions docs/deployment.md
Expand Up @@ -283,20 +283,19 @@ Please add yours!
const { createNodeMiddleware, createProbot } = require("probot");

const app = require("../../../app");
const probot = createProbot({
defaults: {
webhookPath: "/api/github/webhooks",
},
});

module.exports = createNodeMiddleware(app, { probot });
module.exports = createNodeMiddleware(app, {
probot: createProbot(),
webhooksPath: "/api/github/webhooks",
});
```

Examples

- [probot/example-vercel](https://github.com/probot/example-vercel#readme)
- [wip/app](https://github.com/wip/app#readme)
- [all-contributors/app](https://github.com/all-contributors/app#readme)
- [probot-nextjs-starter](https://github.com/maximousblk/probot-nextjs-starter#readme)

Please add yours!

Expand Down
9 changes: 9 additions & 0 deletions docs/development.md
Expand Up @@ -224,6 +224,15 @@ const app = require("./index.js");
module.exports = createNodeMiddleware(app, { probot: createProbot() });
```

By default, `createNodeMiddleware()` uses `/` as the webhook endpoint. To customize this behaviour, you can use the `webhooksPath` option.

```js
module.exports = createNodeMiddleware(app, {
probot: createProbot(),
webhooksPath: "/path/to/webhook/endpoint",
});
```

### Use probot

If you don't use Probot's http handling in order to receive and verify events from GitHub via webhook requests, you can use the [`Probot`](https://probot.github.io/api/latest/classes/probot.html) class directly.
Expand Down

0 comments on commit 624b934

Please sign in to comment.