Skip to content

Instantly share code, notes, and snippets.

@araphiel
Created March 15, 2021 04:10
Show Gist options
  • Save araphiel/8cb299095e672a604baf833d03cb1dff to your computer and use it in GitHub Desktop.
Save araphiel/8cb299095e672a604baf833d03cb1dff to your computer and use it in GitHub Desktop.
Convert parsed body to rawbody
const webhookPayloadParser = (req) =>
new Promise((resolve) => {
let data = ""
req.on("data", (chunk) => {
data += chunk
})
req.on("end", () => {
resolve(Buffer.from(data).toString())
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment