Created
March 15, 2021 04:10
-
-
Save araphiel/8cb299095e672a604baf833d03cb1dff to your computer and use it in GitHub Desktop.
Convert parsed body to rawbody
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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