feat: KoePi oeffentlicher Link bekommt eigenes PWA-Manifest (Dickens Prospekte, eigener Startpunkt)
This commit is contained in:
@@ -873,6 +873,32 @@ router.post('/share-link/disable', authenticate, (req, res) => {
|
||||
res.json({ ok: true });
|
||||
});
|
||||
|
||||
// GET /public/:token/manifest.json – eigenes PWA-Manifest für die öffentliche
|
||||
// Prospekt-Seite: eigener Name ("Dickens Prospekte") und eigener start_url,
|
||||
// damit die installierte App direkt wieder auf der öffentlichen Seite landet
|
||||
// statt auf dem normalen Login der Haupt-App.
|
||||
router.get('/public/:token/manifest.json', (req, res) => {
|
||||
const active = getShareToken();
|
||||
if (!active || req.params.token !== active) return res.status(404).json({ error: 'Nicht gefunden' });
|
||||
res.setHeader('Content-Type', 'application/manifest+json');
|
||||
res.json({
|
||||
name: 'Dickens Prospekte',
|
||||
short_name: 'Prospekte',
|
||||
description: 'Wöchentliche Prospekte',
|
||||
start_url: `/kp/${req.params.token}`,
|
||||
scope: `/kp/${req.params.token}`,
|
||||
display: 'standalone',
|
||||
orientation: 'portrait',
|
||||
background_color: '#0f1117',
|
||||
theme_color: '#0f1117',
|
||||
icons: [
|
||||
{ src: '/favicon.svg', type: 'image/svg+xml', sizes: 'any', purpose: 'any maskable' },
|
||||
{ src: '/icon-192.png', type: 'image/png', sizes: '192x192' },
|
||||
{ src: '/icon-512.png', type: 'image/png', sizes: '512x512' },
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
// GET /public/:token/offers – öffentlich, nur Cache, kein Login
|
||||
router.get('/public/:token/offers', publicRateLimit, async (req, res) => {
|
||||
const active = getShareToken();
|
||||
|
||||
Reference in New Issue
Block a user