corrections
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
47a4d96117
commit
13555d8257
@ -1,19 +1,16 @@
|
||||
module = '/usr/local/lib/node_modules/';
|
||||
console.log('module');
|
||||
const express = require(module + "express");
|
||||
console.log('express');
|
||||
const socketIO = require(module +"socket.io");//('http://82.165.180.114:3000');
|
||||
console.log('socketIO');
|
||||
const app = express();
|
||||
console.log('app');
|
||||
const server = app.listen(3000);
|
||||
const io =socketIO(server);
|
||||
io.on('connection', socket => {
|
||||
console.log("connection de l'utilisateur à l'id ". socket.id);
|
||||
})
|
||||
console.log('ioOnConnection');
|
||||
import { createServer } from "http";
|
||||
import { Server } from "socket.io";
|
||||
|
||||
const httpServer = createServer();
|
||||
const io = new Server(httpServer, {
|
||||
// options
|
||||
});
|
||||
io.on('connection', (socket) => {
|
||||
console.log("connection de l'utilisateur à l'id ". socket.id);
|
||||
});
|
||||
io.on('launchGame' , function () {
|
||||
console.log('launch the game');
|
||||
location.reload();
|
||||
})
|
||||
});
|
||||
|
||||
httpServer.listen(3000);
|
Loading…
Reference in new issue