main.js 724 Bytes
import { createApp } from 'vue'
import App from './App.vue'
import router from './router/index'
import axios from 'axios'
import 'bootstrap/dist/css/bootstrap.css';
import 'bootstrap/dist/js/bootstrap.bundle';



axios.defaults.baseURL = 'http://127.0.0.1:8000/';
axios.defaults.headers.common['Authorization'] = 'Bearer ' + localStorage.getItem('token');
axios.defaults.headers.post['Content-Type'] = 'application/json';
axios.defaults.headers.put['Content-Type'] = 'application/json';
axios.defaults.headers.delete['Content-Type'] = 'application/json';

const app = createApp(App) 

app.config.globalProperties.$axios = axios; // Then set the global properties

app.use(router);
app.mount('#app') // Finally, mount the app