latest
This commit is contained in:
+6
-3
@@ -2,8 +2,11 @@ import axios from 'axios';
|
||||
import { logger } from './debugConfig';
|
||||
|
||||
// Use development backend URL if no custom URL is provided
|
||||
const appProtocol = import.meta.env.VITE_APP_PROTOCOL;
|
||||
const baseURL = `${appProtocol}://${import.meta.env.VITE_APP_API_URL}`;
|
||||
const baseURL = import.meta.env.VITE_API_URL || 'http://localhost:8080';
|
||||
|
||||
if (!import.meta.env.VITE_API_URL) {
|
||||
logger.warn('axios', '⚠️ VITE_API_URL not set, defaulting to http://localhost:8080');
|
||||
}
|
||||
|
||||
const instance = axios.create({
|
||||
baseURL,
|
||||
@@ -65,4 +68,4 @@ instance.interceptors.response.use(
|
||||
export const {isAxiosError} = axios;
|
||||
|
||||
// Export the axios instance with the type guard
|
||||
export default Object.assign(instance, { isAxiosError });
|
||||
export default Object.assign(instance, { isAxiosError });
|
||||
|
||||
Reference in New Issue
Block a user