Hi everyone! In this post I’ll show you a simple way to handle CORS-related problems that usually happen on local development environments. I’ve suffered whit this for too long, and the time to end it has come.
When developing a frontend system that consumes an API, testing services API via cURL or tools like Postman looks great: our methods return the desired responses or errors, and everything works beautifully. But when we finally use our app interface to call the services through a browser (Chrome, Firefox, etc), we can face CORS-related errors, such as:
Access to XMLHttpRequest at 'https://yourapp.api.com' from…
Software engineer at Mercado Livre