I'm getting 403 when it tries to access the endpoint hosted on heroku

This is my website: https://deluxe-fairy-93d7a3.netlify.app

As you can see there are no products displayed. I am hosting the SpringBoot app on heroku and it all works well when I’m accesing the endpoints, but when it tries to access them from heroku I get the 403 error as shown below.

@g1o The errors in the console indicate the problem would be on the Heroku side of things.

Specifically it looks like it’s being blocked by CORS.

1 Like

Thank you for making this clear! Any advice?

I have no idea what you’re doing on the Heroku side of things, but you could just generally look into CORS, why you’re encountering the problem and then either handle it manually or look into using some middleware like cors - npm

1 Like

Thanks you! I’'ll try and come back with the solution.

Using Netlify Rewrites is a simpler solution to avoid CORS.