Merge branch 'develop' into feature/ping-pong
This commit is contained in:
commit
4158779c82
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "mancala-backend",
|
"name": "mancala-backend",
|
||||||
"version": "0.1.3-beta.7",
|
"version": "0.1.3-beta.8",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@ -12,6 +12,6 @@ const matchMaker = new MatchMakerImpl();
|
|||||||
const gameManager = new GameManager({ rtmt, gameStore, matchMaker })
|
const gameManager = new GameManager({ rtmt, gameStore, matchMaker })
|
||||||
|
|
||||||
const expressApp = new ExpressApp();
|
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));
|
rtmt.initWebSocket(server.server, (userKey: string) => gameManager.fireOnPlayerConnected(userKey));
|
||||||
|
|||||||
@ -6,6 +6,10 @@ import fs from "fs";
|
|||||||
import { generateKey } from "../util/key_factory";
|
import { generateKey } from "../util/key_factory";
|
||||||
|
|
||||||
export class ExpressApp {
|
export class ExpressApp {
|
||||||
|
app: Express.Application;
|
||||||
|
constructor() {
|
||||||
|
this.app = this.createExpressApp();
|
||||||
|
}
|
||||||
private createAccessLogMiddleware() {
|
private createAccessLogMiddleware() {
|
||||||
return morgan("common", {
|
return morgan("common", {
|
||||||
stream: fs.createWriteStream("./access.log", { flags: "a" }),
|
stream: fs.createWriteStream("./access.log", { flags: "a" }),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user