I'm learning how to integrate Stripe into React & Express. I'm getting a 404 error. Also, when I try to console.log the req.body, nothing appea...
For further actions, you may consider blocking this person and/or reporting abuse
Usually this issue is due to the order of the middleware being configured. The
app.use(bodyParser.text())
has to be configured before the routes are declared.I've created a glitch project to demonstrate how the code could be implemented.
Good luck π€ with getting the issue sorted.
I find I struggle with fetch requests, and generally reach for Axios. Something about the syntax doesn't compute for me. Might be worth a try.
medium.com/@thejasonfile/fetch-vs-...
Here is a quick overview of the differences I found.
The examples within do a fetch.then passing the results to another function. Maybe that is it.
After going through a whole troubleshoot checklist, including suggestions below (thank you), I went back to the beginning and thought about the error message 404. I looked at my url and the stripe documentation again. Changing
to
solved it. However, I'm not sure why. My other fetch requests on this app use the longer version. Can anyone explain?