[Vuejs]-Dynamically set default baseURL for axios

0👍

Hey seems like one of your async functions doesn’t return any promises.
You can do it like this:

async function getIp() {
  cosnt x = await axios.get("https://api.ipify.org?format=json")
  return 'http://' + JSON.stringify(x.data.ip).replace(/"/g, '') + ':8081'
}

or add a return to the axios.get("https://api.ipify.org?format=json"),
otherwise await getIp() doesn’t know what it needs to await for, let me know if it helps. cheers.

Leave a comment