diff --git a/.env.development b/.env.development new file mode 100644 index 0000000..a2db157 --- /dev/null +++ b/.env.development @@ -0,0 +1 @@ +VITE_API_URL= https://localhost:9500/api \ No newline at end of file diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..5d0dbe5 --- /dev/null +++ b/.env.production @@ -0,0 +1 @@ +VITE_API_URL= https://members.tecamino.com/api \ No newline at end of file diff --git a/src/boot/axios.ts b/src/boot/axios.ts index e3ee246..ed0db55 100644 --- a/src/boot/axios.ts +++ b/src/boot/axios.ts @@ -3,12 +3,11 @@ import type { AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse } fro import axios from 'axios'; import { useLogin } from 'src/vueLib/login/useLogin'; -const host = window.location.hostname; -export const portApp = 9500; +const host = import.meta.env.VITE_API_URL; // Create axios instance export const appApi: AxiosInstance = axios.create({ - baseURL: `https://${host}:${portApp}/api`, + baseURL: host, timeout: 10000, withCredentials: true, });