Actualizar frontend/src/lib/api.js
This commit is contained in:
@@ -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 : ""}`;
|
||||
|
||||
Reference in New Issue
Block a user