Legt de bestaande wijzigingen in de hoofdworktree vast voordat de laatste worktree wordt gemerged.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
45 lines
884 B
JavaScript
45 lines
884 B
JavaScript
require("dotenv").config();
|
|
|
|
const http = require("http");
|
|
const { Server } = require("socket.io");
|
|
|
|
const createApp = require("./config/express");
|
|
const session = require("./config/session");
|
|
const socketHandlers = require("./sockets/handlers");
|
|
|
|
const app = createApp();
|
|
|
|
const server = http.createServer(app);
|
|
|
|
const io = new Server(server, {
|
|
cors: {
|
|
origin: "*",
|
|
methods: ["GET", "POST"]
|
|
}
|
|
});
|
|
|
|
io.use((socket, next) => session(socket.request, {}, next));
|
|
|
|
socketHandlers(io);
|
|
|
|
// Make io available in routes
|
|
app.locals.io = io;
|
|
|
|
const PORT = process.env.PORT || 3000;
|
|
|
|
server.listen(PORT, () => {
|
|
|
|
console.log("");
|
|
|
|
console.log("===================================");
|
|
|
|
console.log("🚀 PantryHub gestart");
|
|
|
|
console.log(`🌍 http://localhost:${PORT}`);
|
|
|
|
console.log("===================================");
|
|
|
|
console.log("");
|
|
|
|
});
|