fixed routes
All checks were successful
Build Frontend / Build Frontend (push) Successful in 22s

This commit is contained in:
2026-01-11 03:02:54 +00:00
parent ac72c6ad27
commit 1f62e148e5
2 changed files with 307 additions and 6 deletions

View File

@@ -37,8 +37,16 @@ const getApiBaseUrl = () => {
};
// Create axios instance
const baseURL = getApiBaseUrl();
console.log("🔧 Creating axios instance with baseURL:", baseURL);
console.log(
"🔧 Environment:",
import.meta.env.PROD ? "PRODUCTION" : "DEVELOPMENT"
);
console.log("🔧 Current hostname:", window.location.hostname);
const axiosInstance = axios.create({
baseURL: getApiBaseUrl(),
baseURL: baseURL,
timeout: 15000,
withCredentials: true,
headers: {
@@ -46,17 +54,22 @@ const axiosInstance = axios.create({
},
});
console.log("✅ Axios instance created with config:", {
baseURL: axiosInstance.defaults.baseURL,
withCredentials: axiosInstance.defaults.withCredentials,
timeout: axiosInstance.defaults.timeout,
});
// Request interceptor
axiosInstance.interceptors.request.use(
(config) => {
// You can add auth token to headers here if needed
// const token = localStorage.getItem('token')
// if (token) {
// config.headers.Authorization = `Bearer ${token}`
// }
// Log every request for debugging
const fullUrl = `${config.baseURL}${config.url}`;
console.log(`📤 Axios Request: ${config.method.toUpperCase()} ${fullUrl}`);
return config;
},
(error) => {
console.error("❌ Axios Request Error:", error);
return Promise.reject(error);
}
);