Front-end and Server connection issues when accessing from another device
Okay so guys, I created a small note taking web-app on MERN stack. The front-end is running at localhost:3000, and the backend is running at localhost:5000, I am getting all the requests and response from the backend using axios. In the backend I’m using app.use(cors()) to avoid any connection issues.
So the issue is, It works perfectly on the pc I’m hosting it on, but when I try to access it from my another device (which is connected to the same wifi as my pc) my putting :3000 in the address bar, it shows the frontend, but when I try to save notes or get them, it doesn’t work. But when I visit :8000/get, I can see my all notes saved there.
So the final issue is, it’s working perfectly on the hosted device, but another device (connected to the same wifi) the front-end and back-end isn’t working together, however they are accessible when separately visiting their respective ports.
For ease, I’ll attach my main react component file, and server.js file