axios gets addres dynamically
This commit is contained in:
@@ -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
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user