From 963295e76b695b8b4de69d529f54d3da087eebae Mon Sep 17 00:00:00 2001 From: Aran Roig Date: Sat, 2 May 2026 17:05:20 +0200 Subject: [PATCH] sisi --- frontend/app/composables/useApi.ts | 20 -------------------- frontend/app/services/BackendURL.js | 2 +- 2 files changed, 1 insertion(+), 21 deletions(-) delete mode 100644 frontend/app/composables/useApi.ts 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