mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
🐛 Fix bug that page did load white after version update
This commit is contained in:
parent
a5344a0998
commit
676cecec66
|
@ -1129,8 +1129,19 @@ class App {
|
||||||
|
|
||||||
|
|
||||||
// Serve the website
|
// Serve the website
|
||||||
|
const startTime = (new Date()).toUTCString();
|
||||||
const editorUiPath = require.resolve('n8n-editor-ui');
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue