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

This commit is contained in:
2026-01-11 02:57:29 +00:00
parent ef987f54b0
commit bfa028c630

View File

@@ -6,6 +6,7 @@ import { useToast } from "vue-toastification";
const getApiBaseUrl = () => { const getApiBaseUrl = () => {
// If VITE_API_URL is set, use it // If VITE_API_URL is set, use it
if (import.meta.env.VITE_API_URL) { if (import.meta.env.VITE_API_URL) {
console.log("🔵 Using VITE_API_URL:", import.meta.env.VITE_API_URL);
return import.meta.env.VITE_API_URL; return import.meta.env.VITE_API_URL;
} }
@@ -19,14 +20,19 @@ const getApiBaseUrl = () => {
currentHost === "turbotrades.dev" || currentHost === "turbotrades.dev" ||
currentHost === "www.turbotrades.dev" currentHost === "www.turbotrades.dev"
) { ) {
return `${protocol}//api.turbotrades.dev/api`; const baseUrl = `${protocol}//api.turbotrades.dev/api`;
console.log("🔵 Production API baseURL:", baseUrl);
return baseUrl;
} }
// For other domains, try api subdomain // For other domains, try api subdomain
return `${protocol}//api.${currentHost}/api`; const baseUrl = `${protocol}//api.${currentHost}/api`;
console.log("🔵 Production API baseURL (custom domain):", baseUrl);
return baseUrl;
} }
// In development, use relative path (Vite proxy handles it) // In development, use relative path (Vite proxy handles it)
console.log("🔵 Development API baseURL: /api");
return "/api"; return "/api";
}; };