Add axios api

This commit is contained in:
Hubert Van De Walle 2020-04-12 15:55:27 +02:00
parent 5b079999bb
commit c95b335e3c
2 changed files with 12 additions and 0 deletions

9
web/src/api/index.js Normal file
View File

@ -0,0 +1,9 @@
import axios from 'axios'
export default axios.create({
baseURL: 'http://localhost:8081',
timeout: 4000,
headers: {
'Content-Type': 'application/json'
}
})

View File

@ -2,6 +2,8 @@ import Vue from 'vue'
import App from './App.vue' import App from './App.vue'
import router from './router' import router from './router'
import store from './store' import store from './store'
import Api from './api'
import BootstrapVue from 'bootstrap-vue' import BootstrapVue from 'bootstrap-vue'
import 'bootswatch/dist/minty/bootstrap.css' import 'bootswatch/dist/minty/bootstrap.css'
@ -15,5 +17,6 @@ Vue.config.productionTip = false
new Vue({ new Vue({
router, router,
store, store,
Api,
render: h => h(App) render: h => h(App)
}).$mount('#app') }).$mount('#app')