-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaboo.js
More file actions
29 lines (23 loc) · 707 Bytes
/
Taboo.js
File metadata and controls
29 lines (23 loc) · 707 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
'use strict';
import http from 'http';
import Game from './Game.js';
import WebServer from './WebServer.js';
import SocketServer from './SocketServer.js';
class Taboo {
constructor (config) {
this.config = config || {};
this.game = new Game();
this.webServer = new WebServer();
this.socketServer = new SocketServer(this.game);
}
listen (port, host) {
this.httpServer = http.createServer();
this.webServer.bindToServer(this.httpServer);
this.socketServer.bindToServer(this.httpServer);
this.httpServer.listen(
port || this.config.port || process.env.PORT || 8080,
host || this.config.host || process.env.HOST || null
);
}
}
export default Taboo;