Skip to content

Commit

Permalink
docs: add webhooksPath option for createNodeMiddleware (probot#1588)
Browse files Browse the repository at this point in the history
  * the previously used version of ioredis was vulnerable to a prototype
    pollution attack: redis/ioredis#1267
  • Loading branch information
maximousblk authored and rethab committed Sep 1, 2021
1 parent 803fa2f commit 8a9f100
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 33 deletions.
11 changes: 5 additions & 6 deletions docs/deployment.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
48 changes: 23 additions & 25 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@probot/octokit-plugin-config": "^1.0.0",
"@probot/pino": "^2.2.0",
"@types/express": "^4.17.9",
"@types/ioredis": "^4.17.8",
"@types/ioredis": "^4.27.1",
"@types/pino": "^6.3.4",
"@types/pino-http": "^5.0.6",
"@types/update-notifier": "^5.0.0",
Expand All @@ -58,7 +58,7 @@
"eventsource": "^1.0.7",
"express": "^4.17.1",
"hbs": "^4.1.1",
"ioredis": "^4.19.2",
"ioredis": "^4.27.8",
"js-yaml": "^3.14.1",
"lru-cache": "^6.0.0",
"octokit-auth-probot": "^1.2.2",
Expand Down

0 comments on commit 8a9f100

Please sign in to comment.