refactor: open takes server not ctor

This commit is contained in:
cha0s 2019-04-20 21:34:49 -05:00
parent 1fe654af60
commit 652e96db4b

View File

@ -10,9 +10,8 @@ const decorateServer = compose(
export class Server extends decorateServer(class {}) {
constructor(httpServer) {
constructor() {
super();
this.httpServer = httpServer;
this.onConnect = this.onConnect.bind(this);
}
@ -25,8 +24,8 @@ export class Server extends decorateServer(class {}) {
this.emit('connect', new ServerSocket(socket));
}
open() {
this.io = new SocketServer(this.httpServer, {
open(httpServer) {
this.io = new SocketServer(httpServer, {
parser: SocketIoParser,
path: '/avocado',
perMessageDeflate: false,