Multiple baseURL support for axios.
npm install axios-multibase
const axios = require('axios')
axios.interceptors.request.use(multibase)
axios.get('/', {
// Use multiple baseURLs with comma seperated:
baseURL: 'http://host1/,http://host2/,http://host3/'
}).then(response => {
console.log(response.data)
})
axios.get('/', {
// Use baseURL array:
baseURL: ['http://host1/', 'http://host2/', 'http://host3/']
}).then(response => {
console.log(response.data)
})
MIT