Skip to content

Commit

Permalink
Update info on how to process webhooks by disabling bodyParser (verce…
Browse files Browse the repository at this point in the history
…l#33909)

Explicitly mention disabling `bodyParser` when processing a webhook request. Uses the "webhook" keyword that becomes searchable in the docs for anyone running a search from the sidebar.

It addresses the issue [here](https://github.com/vercel/documentation/issues/71) and [this discussion](vercel/community#93).

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
  • Loading branch information
amandeepmittal authored and natew committed Feb 16, 2022
1 parent 5b8ed52 commit dfdfcaf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/api-routes/api-middlewares.md
Expand Up @@ -34,7 +34,9 @@ export const config = {

The `api` object includes all configs available for API routes.

`bodyParser` Enables body parsing, you can disable it if you want to consume it as a `Stream`:
`bodyParser` is automatically enabled. If you want to consume the body as a `Stream` or with [`raw-body`](https://www.npmjs.com/package/raw-body), you can set this to `false`.

One use case for disabling the automatic `bodyParsing` is to allow you to verify the raw body of a **webhook** request, for example [from GitHub](https://docs.github.com/en/developers/webhooks-and-events/webhooks/securing-your-webhooks#validating-payloads-from-github).

```js
export const config = {
Expand Down

0 comments on commit dfdfcaf

Please sign in to comment.