This repository has been archived on 2026-10-05. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
dnd-manager/backend/src/index.js
T
2026-09-22 16:27:53 +02:00

21 lines
553 B
JavaScript

require('dotenv').config();
const http = require('http');
const { Server } = require('socket.io');
const { createApp } = require('./app');
const { attachSockets } = require('./sockets');
const PORT = process.env.PORT || 4000;
const app = createApp();
const server = http.createServer(app);
const io = new Server(server, {
cors: { origin: process.env.CORS_ORIGIN || 'http://localhost:5173' },
});
attachSockets(io);
app.set('io', io);
server.listen(PORT, () => {
console.log(`D&D Campaign Manager API listening on http://localhost:${PORT}`);
});