This commit is contained in:
2026-04-26 16:28:38 -05:00
parent a97f372a76
commit 32a00b3706
2 changed files with 119 additions and 6 deletions

View File

@@ -59,7 +59,25 @@ const publicDir = config.publicDir.startsWith('/')
console.log(`Serving frontend from: ${publicDir}`);
app.use(express.static(publicDir));
// Avoid stale frontend JS while we are actively developing the MVP.
app.use((req, res, next) => {
if (
req.path.endsWith('.js') ||
req.path.endsWith('.css') ||
req.path.endsWith('.html')
) {
res.setHeader('Cache-Control', 'no-store, no-cache, must-revalidate, proxy-revalidate');
res.setHeader('Pragma', 'no-cache');
res.setHeader('Expires', '0');
}
next();
});
app.use(express.static(publicDir, {
etag: false,
lastModified: false,
}));
app.get('*', (_req, res) => {
res.sendFile(resolve(publicDir, 'index.html'));