1๐
I found the solution, to make the address generic, I need to use the global variable:
window.location.hostname
That contains the hostname of the machine that runs the Vue app server.
Now when I try to make a request from distant computer, my browser is correctly using the machine hostname, not its own localhost.
This is the new Axios configuration :
const apo = axios.create({
baseURL: `http://${window.location.hostname}:8081/api/route`,
headers: {
'Content-Type': 'text/plain',
},
});
๐คNibor Foo
Source:stackexchange.com