repl.it
@MatthewDoan1/

Multiplayer Phaser Game

Nodejs

No description

fork
loading
Files
  • index.js
  • public
  • Packager files
  • package-lock.json
  • package.json
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const express = require('express');
const socketio = require('socket.io');
const http = require('http');

const app = express();
const server = http.Server(app);
const io = socketio(server);

app.use(express.static('public'));

server.listen(4812, () => console.log("SERVER STARTED!"));

io.on('connection', function(socket)
{
    console.log('A user connected!');

    socket.on('disconnect', function()
    {
        console.log('A user disconnected.');
    });
});