Reputation: 134
I am currently working on project that requires calling two api's. But, how do I set 2 baseURL
.
In my main.js
file
import axios from 'axios'
axios.defaults.baseURL = 'http://192.168.1.75/api'
axios.defaults.baseURL = 'http://192.168.14.66/api'
Upvotes: 1
Views: 145
Reputation: 84
Use prototype method in main.js
file as below:
const authInstance = axios.create({ baseURL: 'http://192.168.1.75/api'})
Vue.prototype.$auth = authInstance
Upvotes: 1