I have been searching google for a couple of hours, been through multiple pages, and watching youtube videos but I am simply not able to find any guidance towards what to do in my case.
I have a react-app frontend running on Nginx.
With the frontend react-app I am running some Axios requests, example:
await axios.post("http://localhost:5000/api/getMessages", {});
I then have my express server receiving the requests and sending back responses, example:
app.post('/api/getMessages', (req, res) => {
Messages.find().sort('-createdAt').limit(10)
.then((result) => {
res.send(result)
})
})
Everything works fine in my local environment, but I am unsure of what to do when putting it on a live server with a domain using Nginx. I am able to get the react-app up and working just fine, but when making an axios request it simply returns net::ERR_CONNECTION_REFUSED
This is with my express server running in the back like a normal node project.