Bad request, missing form when trying to redirect my page to stripe

  • I am running a Netlify hosted site as a staging mirror for my main site
  • The staging site: [Netlify App)
  • The main site: [www.kimiee-kreates.com.)
  • Both are using Node.Js, Html/css

My site is Netlify App and my domain is www.kimiee-kreates.com. I am currently trying to integrate stripe into my website which is already on the live web. My issue is every time I am trying to checkout an item it bring me to a messages stating “Bad Request, missing form”. It worked when I made the local host but it’s not working now on the live site. Can someone explain a way to fix this?

I also think the issue is due to the server not running as well. I have posted my code and results below:

redirect
[/* /create-checkout-session]

package.json
{
“dependencies”: {
“dotenv”: “^16.0.3”,
“express”: “^4.18.2”,
“stripe”: “^10.17.0”
},
“devDependencies”: {
“nodemon”: “^2.0.20”
}

}

netlify.toml
[[redirects]]
from =“/server.js”
to = “/create-checkout-session”
status = 303

Hi there,

This layout looks pretty strange to me. Why would you use a route like server.js in your redirect? We don’t run node.js servers at browse time; perhaps it would be helpful to start out from this website that explains more about our webhosting philosophy:

Express is usually “code that runs at browse time” and we don’t do that except in functions. This is a write-up of how to use express there but I need to suggest that it is a rare use case these days:

Usually, people would integrate stripe very differently, as described in the articles linked from this page:

Take a look at those resources and let me know what you think!

Duplicate: