Node rewrite
This commit is contained in:
18
src/index.ts
Normal file
18
src/index.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import express from 'express'
|
||||
import http from 'http'
|
||||
import { Server } from 'socket.io'
|
||||
import { connectDB } from './config/database'
|
||||
import { setupGameSocket } from './sockets/gameSocket'
|
||||
|
||||
const app = express()
|
||||
const server = http.createServer(app)
|
||||
const io = new Server(server)
|
||||
|
||||
// Connexion à MongoDB
|
||||
connectDB()
|
||||
|
||||
// Configuration de Socket.IO
|
||||
setupGameSocket(io)
|
||||
|
||||
// Routes et Middlewares ici
|
||||
export { app, server }
|
||||
Reference in New Issue
Block a user