From 482eafb8b4f9292a080c7b36c75e145b3c738264 Mon Sep 17 00:00:00 2001 From: josedario87 Date: Fri, 17 Oct 2025 02:15:33 -0600 Subject: [PATCH] =?UTF-8?q?Implementar=20link=20handling=20y=20asociaci?= =?UTF-8?q?=C3=B3n=20con=20PWA=20hub?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Agregar capture_links en manifest para mejorar experiencia PWA - Crear archivo .well-known para asociación con inicio.nucleoriofrio.com - Agregar router público en Traefik para recursos PWA y .well-known --- docker-compose.yml | 7 +++++++ nuxt4-app/nuxt.config.ts | 2 ++ .../public/.well-known/web-app-origin-association | 10 ++++++++++ 3 files changed, 19 insertions(+) create mode 100644 nuxt4-app/public/.well-known/web-app-origin-association diff --git a/docker-compose.yml b/docker-compose.yml index c4d9c6a..1d318e8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -33,6 +33,13 @@ services: # Service - "traefik.http.services.seguidor-lotes.loadbalancer.server.port=3000" + # Router público para recursos PWA (sin autenticación) + - "traefik.http.routers.seguidor-lotes-public.rule=Host(`${APP_DOMAIN}`) && (PathPrefix(`/.well-known`) || Path(`/manifest.webmanifest`) || Path(`/sw.js`) || PathPrefix(`/workbox-`) || PathPrefix(`/icon-`) || Path(`/favicon.ico`))" + - "traefik.http.routers.seguidor-lotes-public.entrypoints=websecure" + - "traefik.http.routers.seguidor-lotes-public.tls.certresolver=letsencrypt" + - "traefik.http.routers.seguidor-lotes-public.priority=100" + - "traefik.http.routers.seguidor-lotes-public.service=seguidor-lotes" + # Middleware (opcional: puedes añadir rate limiting, compression, etc.) - "traefik.http.routers.seguidor-lotes.middlewares=seguidor-lotes-headers" - "traefik.http.middlewares.seguidor-lotes-headers.headers.customrequestheaders.X-Forwarded-Proto=https" diff --git a/nuxt4-app/nuxt.config.ts b/nuxt4-app/nuxt.config.ts index 73b072a..7716667 100644 --- a/nuxt4-app/nuxt.config.ts +++ b/nuxt4-app/nuxt.config.ts @@ -38,6 +38,8 @@ export default defineNuxtConfig({ display: 'standalone', background_color: '#1f2730', theme_color: '#1f2730', + // Capturar enlaces dentro de la app + capture_links: 'existing-client-navigate', icons: [ { src: 'icon-16x16.png', diff --git a/nuxt4-app/public/.well-known/web-app-origin-association b/nuxt4-app/public/.well-known/web-app-origin-association new file mode 100644 index 0000000..2ff6292 --- /dev/null +++ b/nuxt4-app/public/.well-known/web-app-origin-association @@ -0,0 +1,10 @@ +{ + "web_apps": [ + { + "manifest": "https://inicio.nucleoriofrio.com/manifest.webmanifest", + "details": { + "paths": ["/*"] + } + } + ] +}