From 7eb5ab9ab268db1100399d04f5bf57dd1581bfa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Z=C3=BCrcher?= Date: Tue, 4 Nov 2025 15:30:17 +0100 Subject: [PATCH] add env files for dev and production --- .env.development | 1 + .env.production | 1 + src/boot/axios.ts | 5 ++--- 3 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 .env.development create mode 100644 .env.production 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, });