mirror of
https://github.com/AlecM33/Werewolf.git
synced 2025-12-26 07:47:50 +01:00
refactor singletons
This commit is contained in:
@@ -2,8 +2,8 @@ const express = require('express');
|
||||
const router = express.Router();
|
||||
const debugMode = Array.from(process.argv.map((arg) => arg.trim().toLowerCase())).includes('debug');
|
||||
const logger = require('../modules/Logger')(debugMode);
|
||||
const socketManager = new (require('../modules/SocketManager.js'))().getInstance();
|
||||
const gameManager = new (require('../modules/GameManager.js'))().getInstance();
|
||||
const socketManager = (require('../modules/SocketManager.js')).instance;
|
||||
const gameManager = (require('../modules/GameManager.js')).instance;
|
||||
const globals = require('../config/globals.js');
|
||||
const cors = require('cors');
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ const rateLimit = require('express-rate-limit').default;
|
||||
const globals = require('../config/globals.js');
|
||||
const cors = require('cors');
|
||||
|
||||
const gameManager = new GameManager().getInstance();
|
||||
const gameManager = GameManager.instance;
|
||||
|
||||
const gameCreationLimit = process.env.NODE_ENV.trim() === 'production'
|
||||
? 20
|
||||
|
||||
Reference in New Issue
Block a user