relative URL not working with axios in node
问题 On my node server, the following code works axios.get('http://localhost:8080/myPath') // works But relative pathes don't work axios.get('/myPath') // doesn't work I get this error : message:"connect ECONNREFUSED 127.0.0.1:80" port:80 How can I get the relative url work like in the browser ? Relative path should be hitting on port 8080, not 80. Where do I set that on my node server ? 回答1: Create a new instance with custom configuation. like below var instance = axios.create({ baseURL: 'http:/