1
1
mirror of https://github.com/n8n-io/n8n.git synced 2024-10-07 01:58:50 +03:00

🐛 Fix bug that page did load white after version update

This commit is contained in:
Jan Oberhauser 2019-09-20 13:54:06 +02:00
parent a5344a0998
commit 676cecec66

View File

@ -1129,8 +1129,19 @@ class App {
// Serve the website
const startTime = (new Date()).toUTCString();
const editorUiPath = require.resolve('n8n-editor-ui');
this.app.use('/', express.static(pathJoin(pathDirname(editorUiPath), 'dist'), { index: 'index.html' }));
this.app.use('/', express.static(pathJoin(pathDirname(editorUiPath), 'dist'), {
index: 'index.html',
setHeaders: (res, path) => {
if (res.req && res.req.url === '/index.html') {
// Set last modified date manually to n8n start time so
// that it hopefully refreshes the page when a new version
// got used
res.setHeader('Last-Modified', startTime);
}
}
}));
}
}