From 0af7f1724fa8844fbc117adaf86d9ca390e7d4a4 Mon Sep 17 00:00:00 2001 From: Joel Date: Sat, 27 Jun 2026 14:33:42 +0100 Subject: [PATCH] Fix: ruta WS de :param a {param} (Axum 0.8 syntax) --- backend/src/ws/mod.rs | 2 +- deploy.sh | 30 ++++++++++++++++++++++++++++++ k8s/ingress.yml | 16 ++++++++++++++++ 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100755 deploy.sh create mode 100644 k8s/ingress.yml diff --git a/backend/src/ws/mod.rs b/backend/src/ws/mod.rs index f1f0d76..ed0225d 100644 --- a/backend/src/ws/mod.rs +++ b/backend/src/ws/mod.rs @@ -2,7 +2,7 @@ use axum::{Router, routing::get}; pub fn ws_routes() -> Router { Router::new() - .route("/familia/:familia_id", get(ws_familia_handler)) + .route("/familia/{familia_id}", get(ws_familia_handler)) } // WebSocket colaborativo para edición en tiempo real del menú diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..af60d79 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# =================================================== +# NutriApp — Deploy final +# Ejecutar en la Pi: bash ~/nutriapp/deploy.sh +# =================================================== +set -e + +echo "=== 1/3 Configurando registry inseguro para k3s ===" +sudo tee /etc/rancher/k3s/registries.yaml << 'REGISTRY' +mirrors: + "10.43.162.10:5000": + endpoint: + - "http://10.43.162.10:5000" +REGISTRY + +echo "" +echo "=== 2/3 Reiniciando k3s ===" +sudo systemctl restart k3s +echo "Esperando 15s a que k3s levante..." +sleep 15 + +echo "" +echo "=== 3/3 Eliminando pod viejo y verificando ===" +kubectl delete pod -n nutriapp --all --grace-period=0 --force 2>/dev/null || true +sleep 5 +kubectl get pods -n nutriapp +echo "" +echo "Si el pod queda Running, probá:" +echo " curl http://nutriapp.nutriapp:3100/api/health" +echo " curl https://nutriapp.proyectosjoel.com/api/health" diff --git a/k8s/ingress.yml b/k8s/ingress.yml new file mode 100644 index 0000000..8699c86 --- /dev/null +++ b/k8s/ingress.yml @@ -0,0 +1,16 @@ +apiVersion: traefik.io/v1alpha1 +kind: IngressRoute +metadata: + name: nutriapp + namespace: nutriapp +spec: + entryPoints: + - websecure + routes: + - kind: Rule + match: Host(`nutriapp.proyectosjoel.com`) + services: + - name: nutriapp + port: 3100 + tls: + certResolver: cloudflare