Issue
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 socket.io 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!
Back-end
https://chatter-backend-90rs.onrender.com
https://github.com/DenzilJD/chatter-backend
Front-end
https://chatterdjd.netlify.app/
https://github.com/DenzilJD/chatter
Solution
Your signup API
hitting this URL :
Your signup API
should this URL :
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