Files
lightController/src/boot/axios.ts
2025-05-28 21:54:43 +02:00

22 lines
448 B
TypeScript

import { boot } from 'quasar/wrappers';
import axios from 'axios';
const host = window.location.hostname;
const port = 8100;
const baseURL = `http://${host}:${port}`;
const api = axios.create({
baseURL: baseURL,
timeout: 10000,
headers: {
'Content-Type': 'application/json',
},
});
export default boot(({ app }) => {
app.config.globalProperties.$axios = axios;
app.config.globalProperties.$api = api;
});
export { axios, api };