diff --git a/frontend/app/composables/useApi.ts b/frontend/app/composables/useApi.ts deleted file mode 100644 index 32cbe77..0000000 --- a/frontend/app/composables/useApi.ts +++ /dev/null @@ -1,20 +0,0 @@ -// composables/useApi.js -import axios from 'axios'; - -export const useApi = () => { - const config = useRuntimeConfig(); - - const server = axios.create({ - baseURL: config.public.apiBaseUrl, - }); - - server.interceptors.request.use((cfg) => { - const token = localStorage.getItem('token'); - if (token) { - cfg.headers.Authorization = `Bearer ${token}`; - } - return cfg; - }); - - return server; -}; \ No newline at end of file diff --git a/frontend/app/services/BackendURL.js b/frontend/app/services/BackendURL.js index 1912c48..df35e80 100644 --- a/frontend/app/services/BackendURL.js +++ b/frontend/app/services/BackendURL.js @@ -1,4 +1,4 @@ -const backendUrl = process.env.API_BASE_URL || 'http://localhost:5000/api' +const backendUrl = import.meta.env.API_BASE_URL || 'http://localhost:5000/api' export { backendUrl