From f00fa926164a51e43412d1b05e3566bb2b7c6015 Mon Sep 17 00:00:00 2001 From: josedario87 Date: Fri, 17 Oct 2025 02:15:20 -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 - Actualizar Traefik para servir recursos PWA y .well-known sin autenticación --- docker-compose.yml | 6 +++--- nuxt4-app/nuxt.config.ts | 2 ++ .../public/.well-known/web-app-origin-association | 10 ++++++++++ 3 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 nuxt4-app/public/.well-known/web-app-origin-association diff --git a/docker-compose.yml b/docker-compose.yml index 70b04d0..50fea36 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -32,9 +32,9 @@ services: # Service - "traefik.http.services.${APP_NAME}.loadbalancer.server.port=3000" - # Router para assets estáticos de Nuxt (sin autenticación) - mayor prioridad - # SOLO /_nuxt/* para que la aplicación funcione - - "traefik.http.routers.${APP_NAME}-public.rule=Host(`${APP_DOMAIN}`) && PathPrefix(`/_nuxt`)" + # Router para assets estáticos de Nuxt y PWA (sin autenticación) - mayor prioridad + # Incluye recursos PWA y .well-known para scope extensions + - "traefik.http.routers.${APP_NAME}-public.rule=Host(`${APP_DOMAIN}`) && (PathPrefix(`/_nuxt`) || PathPrefix(`/.well-known`) || PathPrefix(`/icons`) || Path(`/manifest.webmanifest`) || Path(`/sw.js`) || PathPrefix(`/workbox-`) || Path(`/favicon.ico`))" - "traefik.http.routers.${APP_NAME}-public.entrypoints=websecure" - "traefik.http.routers.${APP_NAME}-public.tls=true" - "traefik.http.routers.${APP_NAME}-public.tls.certresolver=letsencrypt" diff --git a/nuxt4-app/nuxt.config.ts b/nuxt4-app/nuxt.config.ts index fc151cd..8dd4975 100644 --- a/nuxt4-app/nuxt.config.ts +++ b/nuxt4-app/nuxt.config.ts @@ -89,6 +89,8 @@ export default defineNuxtConfig({ display: 'standalone', background_color: '#1b1209', theme_color: '#c08040', + // Capturar enlaces dentro de la app + capture_links: 'existing-client-navigate', icons: [ { src: '/icons/icon-192.png', sizes: '192x192', type: 'image/png' }, { src: '/icons/icon-512.png', sizes: '512x512', type: 'image/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": ["/*"] + } + } + ] +}