From 137064317236100989109a1d9f1bd2b849dd3b22 Mon Sep 17 00:00:00 2001 From: Dicken Date: Mon, 25 May 2026 15:36:21 +0200 Subject: [PATCH] backend/src/index.js aktualisiert --- backend/src/index.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/backend/src/index.js b/backend/src/index.js index 616366f..5ce5845 100644 --- a/backend/src/index.js +++ b/backend/src/index.js @@ -28,6 +28,16 @@ fs.readdirSync(toolsDir, { withFileTypes: true }) // ── React-Frontend ausliefern ───────────────────────────────────────────────── const PUBLIC = path.join(__dirname, '../public'); + +// Service Worker braucht diesen Header damit er auf '/' zugreifen darf +app.use((req, res, next) => { + if (req.path === '/sw.js') { + res.setHeader('Service-Worker-Allowed', '/'); + res.setHeader('Cache-Control', 'no-cache'); + } + next(); +}); + app.use(express.static(PUBLIC)); app.get('*', (_req, res) => res.sendFile(path.join(PUBLIC, 'index.html')));