sisi
All checks were successful
Build and Deploy Nuxt / build (push) Successful in 41s

This commit is contained in:
2026-05-02 17:05:20 +02:00
parent e12b48b3e1
commit 963295e76b
2 changed files with 1 additions and 21 deletions

View File

@@ -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;
};

View File

@@ -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