I like to move my stripe-webhook to mongodb. Currently I have a nodejs server where I can get the raw body from the request like (because stripe needs the raw request body)
hi andrew, thx for the example! Good to know that at least the stripe api seems to work! But for me its not really a option, because I use the UI-Forms directly from Stripe directly: Stripe Checkout | Stripe Documentation
to get data into mongodb I need their webhook. Of course I could run a own nodejs server like now. But I would like ot move as much code as possible to the same place.
Express executes code from top to bottom. That means that express.json() will be called before express.raw({ type: 'application/json'}) defined in the /webhook endpoint.
So, all you have to do is to move /webhook endpoint before defining express.json() parser.