Files
tautkan-kanban/server/dist/index.js
T
Power BI Dev 88c7c653c2 first init
2026-08-17 10:52:09 +07:00

23 lines
830 B
JavaScript

import http from 'http';
import { Server as SocketIOServer } from 'socket.io';
import { createApp } from './app.js';
import { config } from './config.js';
import { setupSocketHandlers } from './socket/index.js';
import { startTtlCleanupSchedule } from './cron/cleanup.js';
const app = createApp();
const server = http.createServer(app);
const io = new SocketIOServer(server, {
cors: {
origin: '*',
methods: ['GET', 'POST', 'PATCH', 'DELETE'],
},
});
// Setup real-time Socket.io handlers & authorization
setupSocketHandlers(io);
// Start periodic 30-day TTL cleanup (runs every 24 hours)
startTtlCleanupSchedule(24);
server.listen(config.port, () => {
console.log(`🎮 [Retro Kanban Server] Running on http://localhost:${config.port}`);
console.log(`🛡️ Environment: ${config.nodeEnv}`);
});