fix: HTTPS en API URL
This commit is contained in:
@@ -17,7 +17,8 @@ services:
|
|||||||
context: ./frontend
|
context: ./frontend
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
args:
|
args:
|
||||||
- VITE_API_BASE_URL=http://api-leads.escueladerefrigeracion.lat
|
- VITE_API_URL=https://api-leads.escueladerefrigeracion.lat
|
||||||
|
- VITE_API_BASE_URL=https://api-leads.escueladerefrigeracion.lat
|
||||||
container_name: leads_frontend
|
container_name: leads_frontend
|
||||||
restart: always
|
restart: always
|
||||||
expose:
|
expose:
|
||||||
|
|||||||
3
frontend/.env
Normal file
3
frontend/.env
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# URL base de la API Backend de FastAPI
|
||||||
|
VITE_API_URL=https://api-leads.escueladerefrigeracion.lat
|
||||||
|
VITE_API_BASE_URL=https://api-leads.escueladerefrigeracion.lat
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
# Plantilla de variables de entorno para el Frontend (React + Vite)
|
# Plantilla de variables de entorno para el Frontend (React + Vite)
|
||||||
# En producción o desarrollo, reemplazar con la URL correspondiente del backend
|
# En producción o desarrollo, reemplazar con la URL correspondiente del backend
|
||||||
VITE_API_BASE_URL=http://api-leads.escueladerefrigeracion.lat
|
VITE_API_URL=https://api-leads.escueladerefrigeracion.lat
|
||||||
|
VITE_API_BASE_URL=https://api-leads.escueladerefrigeracion.lat
|
||||||
|
|||||||
3
frontend/.env.production
Normal file
3
frontend/.env.production
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Variables de entorno para producción
|
||||||
|
VITE_API_URL=https://api-leads.escueladerefrigeracion.lat
|
||||||
|
VITE_API_BASE_URL=https://api-leads.escueladerefrigeracion.lat
|
||||||
@@ -7,7 +7,9 @@ RUN npm install
|
|||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
ARG VITE_API_BASE_URL=http://api-leads.escueladerefrigeracion.lat
|
ARG VITE_API_URL=https://api-leads.escueladerefrigeracion.lat
|
||||||
|
ARG VITE_API_BASE_URL=https://api-leads.escueladerefrigeracion.lat
|
||||||
|
ENV VITE_API_URL=$VITE_API_URL
|
||||||
ENV VITE_API_BASE_URL=$VITE_API_BASE_URL
|
ENV VITE_API_BASE_URL=$VITE_API_BASE_URL
|
||||||
|
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// Cliente del backend FastAPI de Leads.
|
// Cliente del backend FastAPI de Leads.
|
||||||
const rawUrl = import.meta.env.VITE_API_BASE_URL || "http://localhost:8001";
|
const rawUrl = import.meta.env.VITE_API_URL || import.meta.env.VITE_API_BASE_URL || "https://api-leads.escueladerefrigeracion.lat";
|
||||||
const BASE_URL = rawUrl.replace(/\/+$/, "");
|
const BASE_URL = rawUrl.replace(/\/+$/, "");
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user