This commit is contained in:
@@ -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";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user