From 3981aaa33173023021313d2ce111954ba7b72db1 Mon Sep 17 00:00:00 2001 From: Juan Felipe Zapata Moreno Date: Mon, 12 Jan 2026 11:43:17 -0600 Subject: [PATCH] fix: websocket --- Docker/nginx/nginx.conf | 2 +- app/Http/Controllers/Api/AlertaRoboController.php | 4 ++-- docker-compose.yml | 3 +-- dockerfile | 2 +- routes/api.php | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Docker/nginx/nginx.conf b/Docker/nginx/nginx.conf index ef22270..a1d737a 100644 --- a/Docker/nginx/nginx.conf +++ b/Docker/nginx/nginx.conf @@ -1,5 +1,5 @@ server { - listen 80; + listen 7003; server_name _; root /var/www/arcos-backend/public; index index.php index.html; diff --git a/app/Http/Controllers/Api/AlertaRoboController.php b/app/Http/Controllers/Api/AlertaRoboController.php index 1f9ac03..d377235 100644 --- a/app/Http/Controllers/Api/AlertaRoboController.php +++ b/app/Http/Controllers/Api/AlertaRoboController.php @@ -77,7 +77,7 @@ public function index(Request $request) * Ver una alerta especĂ­fica * GET /api/alertas/{id} */ - public function show(int $id) + public function show(string $id) { $alerta = AlertaRobo::with(['arco', 'usuario'])->find($id); @@ -98,7 +98,7 @@ public function show(int $id) * Confirmar/marcar alerta como vista * PUT /api/alertas/{id}/confirmar */ - public function confirmar(Request $request, int $id) + public function confirmar(Request $request, string $id) { $alerta = AlertaRobo::find($id); diff --git a/docker-compose.yml b/docker-compose.yml index 68290e9..4f917c5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,7 +14,6 @@ services: - DB_DATABASE=${DB_DATABASE} - DB_PORT=${DB_PORT} ports: - - "8000:8000" - "8083:8080" volumes: - ./:/var/www/arcos-backend @@ -29,7 +28,7 @@ services: nginx: image: nginx:alpine ports: - - "${NGINX_PORT}:80" + - "${NGINX_PORT}:7003" volumes: - ./public:/var/www/arcos-backend/public - ./storage:/var/www/arcos-backend/storage diff --git a/dockerfile b/dockerfile index 76f1112..54b4262 100644 --- a/dockerfile +++ b/dockerfile @@ -40,7 +40,7 @@ RUN apk add --no-cache shadow && \ usermod -u ${USER_ID} www-data && \ groupmod -g ${GROUP_ID} www-data -EXPOSE 9000 +EXPOSE 7003 ENTRYPOINT ["/usr/local/bin/entrypoint-dev.sh"] CMD ["php-fpm"] diff --git a/routes/api.php b/routes/api.php index f846fdd..ba7c037 100644 --- a/routes/api.php +++ b/routes/api.php @@ -44,9 +44,9 @@ Route::get('/arcos/{id}/detecciones/dia', [ArcoController::class, 'deteccionesDelDia']); //alerta + Route::get('/alertas/pendientes', [AlertaRoboController::class, 'pendientes']); Route::get('/alertas', [AlertaRoboController::class, 'index']); Route::get('/alertas/{id}', [AlertaRoboController::class, 'show']); - Route::get('/alertas/pendientes', [AlertaRoboController::class, 'pendientes']); Route::put('/alertas/{id}/confirmar', [AlertaRoboController::class, 'confirmar']); });