diff --git a/src/main.ts b/src/main.ts index 7857381..63c97c1 100644 --- a/src/main.ts +++ b/src/main.ts @@ -49,10 +49,14 @@ watch ( }, {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({ - baseURL: 'https://zamowienia-test.mleczarnia-kuzma.pl/api', + baseURL: baseURL, withCredentials: true });