2019-08-31 17:19:48 +00:00
|
|
|
import axiosHttp from 'axios'
|
|
|
|
|
|
|
|
|
|
export const axios = axiosHttp
|
|
|
|
|
|
|
|
|
|
axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'
|
|
|
|
|
axios.defaults.headers.common['Content-Type'] = 'application/json'
|
2019-09-11 07:25:14 +00:00
|
|
|
axios.defaults.baseURL = process.env.NODE_ENV === 'development' ? 'http://localhost:5000/' : 'https://api.leaguestats.gg/'
|
2019-08-31 17:19:48 +00:00
|
|
|
|
2020-01-02 12:18:43 +00:00
|
|
|
const CancelToken = axios.CancelToken
|
|
|
|
|
const axiosSource = CancelToken.source()
|
|
|
|
|
axios.defaults.axiosSource = axiosSource
|
|
|
|
|
axios.defaults.cancelToken = axiosSource.token
|
|
|
|
|
|
2019-08-31 17:19:48 +00:00
|
|
|
export default {
|
|
|
|
|
install (Vue) {
|
|
|
|
|
Vue.prototype.$axios = axiosHttp
|
|
|
|
|
}
|
|
|
|
|
}
|