repl.it
@MatthewDoan1/

Sprouts Game

Express

No description

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

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

const game = require('./game-server.js');

const settings = JSON.parse(fs.readFileSync('settings.json'));

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

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

server.listen(settings.port, () => console.log('server started'));

const gameServer = new game.Server(settings, io);