INIT commit

This commit is contained in:
Michal Kváček
2023-05-31 20:44:10 +02:00
commit a3e8917db5
73 changed files with 5405 additions and 0 deletions
View File
+27
View File
@@ -0,0 +1,27 @@
import {boot} from 'quasar/wrappers'
import axios from 'axios'
const accessToken = localStorage.getItem("accessToken")
const api = axios.create({
baseURL: 'http://localhost:8000',
withCredentials: true,
xsrfHeaderName: "X-CSRF-TOKEN",
headers: {
Accept: "application/json",
"Content-Type": "application/json;charset=UTF-8",
},
})
export default boot(({app}) => {
// for use inside Vue files (Options API) through this.$axios and this.$api
app.config.globalProperties.$axios = axios
// ^ ^ ^ this will allow you to use this.$axios (for Vue Options API form)
// so you won't necessarily have to import axios in each vue file
app.config.globalProperties.$api = api
// ^ ^ ^ this will allow you to use this.$api (for Vue Options API form)
// so you can easily perform requests against your app's API
})
export {axios, api}