u
This commit is contained in:
@@ -232,7 +232,7 @@ app.get('/api/history', (req, res) => {
|
||||
}
|
||||
|
||||
const stmt = db.prepare(`
|
||||
SELECT timestamp, temp_c, humidity, vpd, fan_speed, on_speed
|
||||
SELECT timestamp || 'Z' as timestamp, temp_c, humidity, vpd, fan_speed, on_speed
|
||||
FROM readings
|
||||
WHERE dev_name = ? AND port = ? AND timestamp >= datetime('now', ?)
|
||||
ORDER BY timestamp ASC
|
||||
@@ -252,6 +252,12 @@ app.get('/api/history', (req, res) => {
|
||||
const devMiddleware = webpackDevMiddleware(compiler, {
|
||||
publicPath: '/',
|
||||
writeToDisk: false,
|
||||
headers: (req, res, context) => {
|
||||
// Set cache headers for hashed bundle files (immutable)
|
||||
if (req.url && req.url.match(/\.[a-f0-9]{8,}\.(js|css)$/i)) {
|
||||
res.setHeader('Cache-Control', 'public, max-age=31536000, immutable');
|
||||
}
|
||||
}
|
||||
});
|
||||
app.use(devMiddleware);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user