From 1d9e23cc660017cdc718e3c1e4251656a7b3c14d Mon Sep 17 00:00:00 2001 From: dmolinari Date: Tue, 17 Jun 2025 18:29:32 -0300 Subject: [PATCH] =?UTF-8?q?Correci=C3=B3n=20de=20Rutas.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Frontend/.env.production | 2 ++ Frontend/src/services/apiClient.ts | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 Frontend/.env.production diff --git a/Frontend/.env.production b/Frontend/.env.production new file mode 100644 index 0000000..eda4d95 --- /dev/null +++ b/Frontend/.env.production @@ -0,0 +1,2 @@ +# Frontend/.env.production +VITE_API_BASE_URL=http://192.168.4.128:8081/api \ No newline at end of file diff --git a/Frontend/src/services/apiClient.ts b/Frontend/src/services/apiClient.ts index 0db2df9..3f648a9 100644 --- a/Frontend/src/services/apiClient.ts +++ b/Frontend/src/services/apiClient.ts @@ -1,8 +1,8 @@ import axios from 'axios'; -// Obtén la URL base de tu API desde variables de entorno o configúrala aquí -// Asegúrate que coincida con la URL donde corre tu API ASP.NET Core -const API_BASE_URL = 'http://localhost:5183/api'; // ¡AJUSTA EL PUERTO SI ES DIFERENTE! (Verifica la salida de 'dotnet run') +// Vite reemplazará import.meta.env.VITE_API_BASE_URL con el valor del .env +// durante la compilación. Si no está definida, usará la URL de desarrollo. +const API_BASE_URL = import.meta.env.VITE_API_BASE_URL || 'http://localhost:5183/api'; const apiClient = axios.create({ baseURL: API_BASE_URL,