Implement HeaderAdBanner component and integrate ad loading logic with consent handling

This commit is contained in:
Torsten Schulz (local)
2026-05-18 15:06:29 +02:00
parent 37d752cce9
commit 44dd757243
7 changed files with 275 additions and 57 deletions

View File

@@ -160,6 +160,17 @@ if (IS_PRODUCTION) {
// Statische Dateien aus docroot
app.use('/static', express.static(join(__dirname, '../docroot')));
// Service Worker unter Root ausliefern (wird oft für AdProvider Verifikation verlangt)
app.get('/sw.js', (req, res) => {
try {
res.setHeader('Content-Type', 'application/javascript');
res.setHeader('Cache-Control', 'no-cache, no-store, must-revalidate');
res.sendFile(join(__dirname, '../sw.js'));
} catch (err) {
res.status(404).send('Not found');
}
});
// SEO-Routes (robots.txt, sitemap.xml, Pre-Rendering)
// Müssen vor anderen Routes stehen, damit sie nicht vom SPA-Fallback abgefangen werden
setupSEORoutes(app, __dirname);