I am deploying my first app on heroku. (It's a node.js/react app.) The app has deployed successfully, but when I try to login I get this error:
Access to XMLHttpRequest at 'https://<myApp>.herokuapp.com/users' from origin
'https://<myApp>-front-end.herokuapp.com' has been blocked by CORS policy:
Response to preflight request doesn't pass access control check: No 'Access-
Control-Allow-Origin' header is present on the requested resource.
I know other answers explain how to fix this problem with a proxy url, but I am wondering whether I did something wrong in the first place. Following an online tutorial, I deployed the front end and back end separately, and that seems to be causing the problem. Should I have deployed the front end and back end together to avoid this problem? Or is getting around this problem a normal part of deploying an app?