axios gets addres dynamically

This commit is contained in:
2025-03-18 14:52:48 +01:00
parent 0ccb091125
commit 424aae99a0

View File

@@ -49,10 +49,14 @@ watch (
}, },
{deep: true} {deep: true}
) )
const currentUrl = window.location.href
export const baseURL = currentUrl.includes("localhost")
? "https://zamowienia-test.mleczarnia-kuzma.pl/api"
: currentUrl.substring(0, currentUrl.lastIndexOf("/") ) + "/api" ;
export const axiosInstance = axios.create({ export const axiosInstance = axios.create({
baseURL: 'https://zamowienia-test.mleczarnia-kuzma.pl/api', baseURL: baseURL,
withCredentials: true withCredentials: true
}); });