feat: add PWA support (manifest, service worker, icons)
This commit is contained in:
@@ -25,6 +25,7 @@ app.use(helmet({
|
||||
fontSrc: ["'self'", 'https://fonts.gstatic.com'],
|
||||
imgSrc: ["'self'", 'data:'],
|
||||
connectSrc: ["'self'", 'https://api.open-meteo.com'],
|
||||
workerSrc: ["'self'"],
|
||||
frameAncestors: ["'none'"],
|
||||
objectSrc: ["'none'"],
|
||||
},
|
||||
@@ -32,6 +33,10 @@ app.use(helmet({
|
||||
}));
|
||||
app.use(express.json());
|
||||
app.use(cookieParser());
|
||||
app.get('/sw.js', (req, res, next) => {
|
||||
res.setHeader('Cache-Control', 'no-cache');
|
||||
next();
|
||||
});
|
||||
app.use(express.static(path.join(__dirname, 'public')));
|
||||
app.use('/api', routes);
|
||||
app.use('/api/files', filesRouter);
|
||||
|
||||
Reference in New Issue
Block a user