mirror of
https://github.com/AlecM33/Werewolf.git
synced 2025-12-30 17:57:49 +01:00
allow local admin dashboard (#212)
* allow local admin dashboard * removed 'unused' constant...
This commit is contained in:
@@ -4,9 +4,19 @@ const debugMode = Array.from(process.argv.map((arg) => arg.trim().toLowerCase())
|
||||
const logger = require('../modules/Logger')(debugMode);
|
||||
const eventManager = (require('../modules/singletons/EventManager.js')).instance;
|
||||
const cors = require('cors');
|
||||
const { CORS_OPTIONS, CONTENT_TYPE_VALIDATOR } = require('../config/globals');
|
||||
const { CONTENT_TYPE_VALIDATOR } = require('../config/globals');
|
||||
|
||||
router.use(cors(CORS_OPTIONS));
|
||||
router.use(cors(
|
||||
(process.env.NODE_ENV?.trim() === 'development'
|
||||
? {
|
||||
origin: '*',
|
||||
optionsSuccessStatus: 200
|
||||
}
|
||||
: {
|
||||
origin: 'http://localhost:3000',
|
||||
optionsSuccessStatus: 200
|
||||
})
|
||||
));
|
||||
|
||||
router.post('/sockets/broadcast', (req, res, next) => {
|
||||
CONTENT_TYPE_VALIDATOR(req, res, next);
|
||||
|
||||
Reference in New Issue
Block a user