Hosted Front-end Unable to Access Hosted Backend, but Local Front-end is Able to Access Hosted Back-end


I have created a MERN chat-app and am facing a few problems. Everything works fine, locally. The problems only start when I host my project, which are as follows:
I am unable to access the hosted backend from my hosted frontend.
The weird part is that if I am running the frontend locally (and calling the hosted backend), it works fine (except for the part, which obviously can only be accessed with permission). When I use a proxy, I get a 404 error, and when I don’t, I get a cors error. I also tried installing the cors package, but that again gave a 404 error. Please tell me where am I messing up. Thanks in advance!




Your signup API hitting this URL :

enter image description here

Your signup API should this URL :
enter image description here

Answered By – Jayesh Cholkar

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published