fix(web-app): Caddy templates für text/html + SW-Bypass für config.json
All checks were successful
Build and Publish Docker Images / build-and-push (., backend/infrastructure/gateway/Dockerfile, api-gateway, api-gateway) (push) Successful in 7m0s
Build and Publish Docker Images / build-and-push (., backend/services/ping/Dockerfile, ping-service, ping-service) (push) Successful in 7m1s
Build and Publish Docker Images / build-and-push (., config/docker/caddy/web-app/Dockerfile, web-app, web-app) (push) Successful in 2m0s
Build and Publish Docker Images / build-and-push (., config/docker/keycloak/Dockerfile, keycloak, keycloak) (push) Successful in 1m50s

Co-authored-by: Junie <junie@jetbrains.com>
This commit is contained in:
Stefan Mogeritsch 2026-03-14 13:23:28 +01:00
parent 3f9b63466c
commit 9747b9957f
7 changed files with 9 additions and 3 deletions

View File

@ -20,10 +20,10 @@
# Komprimierung
encode gzip zstd
# Caddy-Template-Engine für config.json (liefert API_BASE_URL & KEYCLOAK_URL an den Browser)
# Caddy-Template-Engine: ersetzt {{.Env.VAR}} in index.html UND config.json
templates {
mime application/json
}
mime text/html application/json
}
# API-Proxy (höchste Priorität vor dem SPA-Fallback)
handle /api/* {

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 KiB

View File

@ -68,6 +68,12 @@ self.addEventListener('fetch', (event) => {
return;
}
// Laufzeit-Config immer direkt vom Netzwerk niemals aus dem Cache
if (url.pathname === '/config.json') {
event.respondWith(fetch(req).catch(() => new Response('{}', { status: 200, headers: { 'Content-Type': 'application/json' } })));
return;
}
// Avoid noisy errors for favicon during dev/prod when missing
if (url.pathname === '/favicon.ico') {
event.respondWith(