feat: persist sessions and add unsaved-change modals
This commit is contained in:
18
server.js
18
server.js
@@ -430,10 +430,18 @@ app.get('*', (req, res) => {
|
||||
res.sendFile(path.join(__dirname, 'build', 'index.html'));
|
||||
});
|
||||
|
||||
app.listen(port, () => {
|
||||
console.log(`Server läuft auf Port ${port}`);
|
||||
});
|
||||
async function startServer() {
|
||||
try {
|
||||
await restoreSessionsFromDisk();
|
||||
} catch (error) {
|
||||
console.error('[RESTORE] Fehler bei der Session-Wiederherstellung:', error.message);
|
||||
}
|
||||
app.listen(port, () => {
|
||||
console.log(`Server läuft auf Port ${port}`);
|
||||
});
|
||||
}
|
||||
|
||||
restoreSessionsFromDisk().catch((error) => {
|
||||
console.error('[RESTORE] Fehler bei der Session-Wiederherstellung:', error.message);
|
||||
startServer().catch((error) => {
|
||||
console.error('[STARTUP] Unerwarteter Fehler:', error);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user