Join 1M+ other developers and:
- Get help and share knowledge in Q&A
- Subscribe to topics of interest
- Get courses & tools that help you grow as a developer or small business owner
CORS not recognizing prefixed URL?
As I am working to connect my react-app with my node back-end, both using DO’s App Platform, I struggle with CORS. As I found out I need t make changes in app settings, done. My app now allows the origin “https://xxxx-front-end-mbxab.ondigitalocean.app”, the URL of my react app.
services: - cors: allow_headers: - 'Authorization' allow_methods: - GET - POST - PUT - DELETE allow_origins: - prefix: https://xxxx-front-end-mbxab.ondigitalocean.app
However, when making the request via https://xxxx-front-end-mbxab.ondigitalocean.app/app/dashboard I get the following error: “Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://back-end-wju6y.ondigitalocean.app/cats/requests. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).”
Is this normal due to limits or am I making a mistake? Because, I have checked this out, using Postman and two browser-based testers APIs are doing fine. That’s confusing.
Does anybody have an idea or solution for this? Would be great.
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.×