Conectar BASE_URL del frontend dinamicamente a VITE_API_URL en lugar de localhost:8000
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
// src/lib/api.js
|
// src/lib/api.js
|
||||||
// Cliente para el backend FastAPI. Cambia BASE_URL si el backend corre en otra IP.
|
// Cliente para el backend FastAPI. Cambia BASE_URL si el backend corre en otra IP.
|
||||||
const BASE_URL = "http://localhost:8000";
|
const BASE_URL = import.meta.env.VITE_API_URL || "https://dashboardapi.escueladerefrigeracion.edu.pe";
|
||||||
|
|
||||||
async function get(path, params = {}) {
|
async function get(path, params = {}) {
|
||||||
const qs = new URLSearchParams(params).toString();
|
const qs = new URLSearchParams(params).toString();
|
||||||
|
|||||||
Reference in New Issue
Block a user