Actualizar frontend/src/lib/api.js

This commit is contained in:
2026-06-28 03:14:06 -05:00
parent 0f9cec175e
commit 3e95a1467c

View File

@@ -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 : ""}`;