Merge pull request #6 from jhalitaksoy/fix/express-issue

fix express issue
This commit is contained in:
Halit Aksoy 2022-07-16 17:45:36 +03:00 committed by GitHub
commit ff436ed0d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -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));

View File

@ -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" }),