fix: centralize app API URL fallbacks
app-ci-deploy / test-build-deploy (push) Has been cancelled

This commit is contained in:
2026-05-28 19:26:00 +01:00
parent 65ce1bede8
commit fedbd903ff
27 changed files with 110 additions and 38 deletions
+4 -3
View File
@@ -1,11 +1,12 @@
import axios from 'axios';
import { API_BASE as CONFIG_API_BASE } from './config/apiConfig';
import { logger } from './debugConfig';
// Use development backend URL if no custom URL is provided
const baseURL = import.meta.env.VITE_API_BASE || 'http://localhost:8080';
const baseURL = CONFIG_API_BASE;
if (!import.meta.env.VITE_API_BASE) {
logger.warn('axios', '⚠️ VITE_API_BASE not set, defaulting to http://localhost:8080');
if (!import.meta.env.VITE_API_BASE && !import.meta.env.VITE_API_URL) {
logger.warn('axios', '⚠️ VITE_API_BASE not set, using relative /api fallback');
}
const instance = axios.create({