Question

All my express endpoints are getting redirected to GET requests on app platform

I have an express project which I deployed to app platform and it currently has 2 endpoints - GET /trades and POST /trades.

Locally they both hit their respective handler code but when deployed to app platform i’m seeing that my POST request is getting redirected from a POST to a GET request.

Is this expected and is there a way to not have app platform do this?


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hey there!

Are those requests being issued over HTTP? App Platform forces HTTPS so if the request is made over HTTP it will be redirected which could change the request to a GET. I’d recommend making sure those POST requests are using HTTPS to not go through the HTTPS redirect.

Hope it helps! Nate