I am having trouble making axios calls to my backend api on render (it works fine on my local dev environment). I can access my front-end at https://frontend.com but then after a certain timeout, I see in my console:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://mybackend.onrender.com:5000/something. (Reason: CORS request did not succeed). Status code: (null).
I am logging req.headers.host on the express.js side and despite req.headers.host matching res.header(“Access-Control-Allow-Origin”, “…”) the request does not succeed. req.headers.referer is “undefined”, or results in some IP address.
Any ideas on how I can further troubleshoot this?