repl.it
@MatthewDoan1/

Finally working-1

Express

No description

fork
loading
Files
  • index.js
  • public
  • game.js
  • 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
"use strict";

const express = require('express');
//you can have the server & socket setup on one line

//const socketio = require('socket.io'); 
//const http = require('http');

const game = require('./game.js');
const app = express();

const server =  require('http').Server(app); 
const io = require('socket.io').listen(server);

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

server.listen(process.env.PORT || 3050, () => console.log('server started'));

const gameServer = new game.Server(io);