From 3e95a1467c2c128211a51a2b2e7f832c0b0dc1dc Mon Sep 17 00:00:00 2001 From: Administrator Date: Sun, 28 Jun 2026 03:14:06 -0500 Subject: [PATCH] Actualizar frontend/src/lib/api.js --- frontend/src/lib/api.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/frontend/src/lib/api.js b/frontend/src/lib/api.js index 958d367..e3bed71 100644 --- a/frontend/src/lib/api.js +++ b/frontend/src/lib/api.js @@ -1,7 +1,5 @@ -// src/lib/api.js -// Cliente para el backend FastAPI. Cambia BASE_URL si el backend corre en otra IP. -const BASE_URL = "http://localhost:8000"; - +// ✅ DESPUÉS — Vite inyecta el valor real durante npm run build +const BASE_URL = import.meta.env.VITE_API_URL || "http://localhost:8000"; async function get(path, params = {}) { const qs = new URLSearchParams(params).toString(); const url = `${BASE_URL}${path}${qs ? "?" + qs : ""}`;