diff --git a/src/index.ts b/src/index.ts index d414686..f5b97d8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -12,6 +12,6 @@ const matchMaker = new MatchMakerImpl(); const gameManager = new GameManager({ rtmt, gameStore, matchMaker }) const expressApp = new ExpressApp(); -const server = new WebServer({expressApp}); +const server = new WebServer({ expressApp: expressApp.app }); rtmt.initWebSocket(server.server, (userKey: string) => gameManager.fireOnPlayerConnected(userKey)); diff --git a/src/server/ExpressApp.ts b/src/server/ExpressApp.ts index 5f57854..8638fea 100644 --- a/src/server/ExpressApp.ts +++ b/src/server/ExpressApp.ts @@ -6,6 +6,10 @@ import fs from "fs"; import { generateKey } from "../util/key_factory"; export class ExpressApp { + app: Express.Application; + constructor() { + this.app = this.createExpressApp(); + } private createAccessLogMiddleware() { return morgan("common", { stream: fs.createWriteStream("./access.log", { flags: "a" }),