Update runtime ports and deployment defaults.
Switch backend/frontend to ports 8074/8075 and align Docker, CORS, frontend API base URL, and docs so deployment uses the new endpoints consistently.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# URL base del backend (accesible desde el navegador)
|
||||
VITE_API_URL=http://localhost:8000
|
||||
VITE_API_URL=http://localhost:8074
|
||||
|
||||
# (Opcional) Client ID de Google para "Iniciar sesión con Google".
|
||||
# Debe coincidir con GOOGLE_CLIENT_ID del backend.
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
FROM node:20-alpine AS build
|
||||
WORKDIR /app
|
||||
|
||||
ARG VITE_API_URL=http://localhost:8000
|
||||
ARG VITE_API_URL=http://localhost:8074
|
||||
ARG VITE_GOOGLE_CLIENT_ID=
|
||||
ENV VITE_API_URL=$VITE_API_URL
|
||||
ENV VITE_GOOGLE_CLIENT_ID=$VITE_GOOGLE_CLIENT_ID
|
||||
|
||||
+4
-4
@@ -25,20 +25,20 @@ src/
|
||||
|
||||
## Desarrollo local
|
||||
|
||||
Requisitos: Node 20+ y el backend corriendo en `http://localhost:8000`.
|
||||
Requisitos: Node 20+ y el backend corriendo en `http://localhost:8074`.
|
||||
|
||||
```bash
|
||||
cd frontend
|
||||
cp .env.example .env # ajusta VITE_API_URL si es necesario
|
||||
npm install
|
||||
npm run dev # http://localhost:5173
|
||||
npm run dev # http://localhost:8075
|
||||
```
|
||||
|
||||
## Variables de entorno
|
||||
|
||||
| Variable | Descripción |
|
||||
| ----------------------- | -------------------------------------------------------- |
|
||||
| `VITE_API_URL` | URL base del backend (por defecto `http://localhost:8000`). |
|
||||
| `VITE_API_URL` | URL base del backend (por defecto `http://localhost:8074`). |
|
||||
| `VITE_GOOGLE_CLIENT_ID` | (Opcional) Client ID de Google. Si está vacío, se oculta el botón de Google. |
|
||||
|
||||
> Las variables `VITE_*` se incrustan en el build, por lo que apuntan al backend
|
||||
@@ -54,7 +54,7 @@ npm run preview # sirve el build localmente
|
||||
## Docker
|
||||
|
||||
El `docker-compose.yml` de la raíz construye el frontend con un build multi-stage
|
||||
(Node → Nginx) y lo publica en `http://localhost:5173`:
|
||||
(Node → Nginx) y lo publica en `http://localhost:8075`:
|
||||
|
||||
```bash
|
||||
docker compose up --build
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import axios from "axios";
|
||||
|
||||
export const API_URL =
|
||||
import.meta.env.VITE_API_URL?.replace(/\/$/, "") || "http://localhost:8000";
|
||||
import.meta.env.VITE_API_URL?.replace(/\/$/, "") || "http://localhost:8074";
|
||||
|
||||
const TOKEN_KEY = "genex_token";
|
||||
|
||||
|
||||
@@ -5,6 +5,6 @@ export default defineConfig({
|
||||
plugins: [react()],
|
||||
server: {
|
||||
host: true,
|
||||
port: 5173,
|
||||
port: 8075,
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user