Dieser Commit ist enthalten in:
hendrik_gebhardt@gmx.de
2026-01-06 21:49:26 +00:00
committet von Server Deploy
Ursprung 623bbdf5dd
Commit 7d67557be4
34 geänderte Dateien mit 21416 neuen und 2367 gelöschten Zeilen

Datei anzeigen

@ -41,11 +41,13 @@ const adminRoutes = require('./routes/admin');
const proposalRoutes = require('./routes/proposals');
const notificationRoutes = require('./routes/notifications');
const notificationService = require('./services/notificationService');
const reminderService = require('./services/reminderService');
const gitRoutes = require('./routes/git');
const applicationsRoutes = require('./routes/applications');
const giteaRoutes = require('./routes/gitea');
const knowledgeRoutes = require('./routes/knowledge');
const codingRoutes = require('./routes/coding');
const reminderRoutes = require('./routes/reminders');
// Express App erstellen
const app = express();
@ -106,8 +108,17 @@ app.use((req, res, next) => {
next();
});
// Statische Dateien (Frontend)
app.use(express.static(path.join(__dirname, 'public')));
// Statische Dateien (Frontend) - ohne Caching für Development
app.use(express.static(path.join(__dirname, 'public'), {
etag: false,
lastModified: false,
cacheControl: false,
setHeaders: (res, path) => {
res.setHeader('Cache-Control', 'no-store, no-cache, must-revalidate');
res.setHeader('Pragma', 'no-cache');
res.setHeader('Expires', '0');
}
}));
// Uploads-Ordner
app.use('/uploads', authenticateToken, express.static(process.env.UPLOAD_DIR || path.join(__dirname, 'uploads')));
@ -160,6 +171,12 @@ app.use('/api/knowledge', authenticateToken, csrfProtection, knowledgeRoutes);
// Coding-Routes (Entwicklungsverzeichnisse mit Claude/Codex)
app.use('/api/coding', authenticateToken, csrfProtection, codingRoutes);
// Reminder-Routes (Erinnerungen)
app.use('/api/reminders', authenticateToken, csrfProtection, reminderRoutes);
// Contacts-Routes (Kontakte)
app.use('/api/contacts', authenticateToken, csrfProtection, require('./routes/contacts'));
// =============================================================================
// SOCKET.IO
// =============================================================================
@ -296,6 +313,10 @@ database.initialize()
notificationService.checkDueTasks(io);
logger.info('Fälligkeits-Check für Benachrichtigungen gestartet');
}, 60 * 1000);
// Reminder Service starten
const reminderServiceInstance = reminderService.getInstance(io);
reminderServiceInstance.start();
});
})
.catch((err) => {
@ -306,6 +327,11 @@ database.initialize()
// Graceful Shutdown
process.on('SIGTERM', () => {
logger.info('SIGTERM empfangen, fahre herunter...');
// Reminder Service stoppen
const reminderServiceInstance = reminderService.getInstance();
reminderServiceInstance.stop();
server.close(() => {
database.close();
logger.info('Server beendet');
@ -315,6 +341,11 @@ process.on('SIGTERM', () => {
process.on('SIGINT', () => {
logger.info('SIGINT empfangen, fahre herunter...');
// Reminder Service stoppen
const reminderServiceInstance = reminderService.getInstance();
reminderServiceInstance.stop();
server.close(() => {
database.close();
logger.info('Server beendet');