diff --git a/WEB/server.js b/WEB/server.js index 8e00038c..6b7a5e44 100644 --- a/WEB/server.js +++ b/WEB/server.js @@ -1,11 +1,22 @@ //const io = require('socket.io')('http://localhost:3000'); +const http = require('http'); const io = require('socket.io')('http://82.165.180.114:3000'); -io.on('connection', socket => { +const server = http.createServer((req,res) => { + res.end('Création du serveur'); +}); + +const socketServer = io(server); + +socketServer.on('connection', socket => { console.log("connection de l'utilisateur à l'id ". socket.id); }) -io.on('launchGame') , function () { +socketServer.on('launchGame') , function () { console.log('launch the game'); location.reload(); -} \ No newline at end of file +} + +server.listen(3000, () => { + console.log('app listening on port 3000') +}); \ No newline at end of file