diff --git a/client/src/scripts/home.js b/client/src/scripts/home.js index 77364d9..bddc7d7 100644 --- a/client/src/scripts/home.js +++ b/client/src/scripts/home.js @@ -28,7 +28,7 @@ function attemptToJoinGame (code) { ) .then((res) => { if (res.status === 200) { - let json = JSON.parse(res.content); + const json = JSON.parse(res.content); window.location = window.location.protocol + '//' + window.location.host + '/join/' + encodeURIComponent(json.accessCode) + '?playerCount=' + encodeURIComponent(json.playerCount) + @@ -45,7 +45,7 @@ function attemptToJoinGame (code) { }); } -function getTimeString(timerParams) { +function getTimeString (timerParams) { let timeString = ''; if (timerParams) { const hours = timerParams.hours; diff --git a/server/api/GamesAPI.js b/server/api/GamesAPI.js index 061f424..f5aca63 100644 --- a/server/api/GamesAPI.js +++ b/server/api/GamesAPI.js @@ -77,7 +77,7 @@ router.patch('/:code/players', function (req, res) { } else { const game = gameManager.activeGameRunner.activeGames[req.body.accessCode]; if (game) { - let inUseCookie = gameManager.environment === globals.ENVIRONMENT.PRODUCTION ? req.body.localCookie : req.body.sessionCookie + const inUseCookie = gameManager.environment === globals.ENVIRONMENT.PRODUCTION ? req.body.localCookie : req.body.sessionCookie; gameManager.joinGame(game, req.body.playerName, inUseCookie).then((data) => { res.status(200).send({ cookie: data, environment: gameManager.environment }); }).catch((code) => { @@ -98,7 +98,7 @@ function validateName (name) { } function validateCookie (cookie) { - return cookie === null || cookie === false || (typeof cookie === 'string' && cookie.length === globals.USER_SIGNATURE_LENGTH) + return cookie === null || cookie === false || (typeof cookie === 'string' && cookie.length === globals.USER_SIGNATURE_LENGTH); } function validateAccessCode (accessCode) { diff --git a/server/modules/ServerBootstrapper.js b/server/modules/ServerBootstrapper.js index 207830b..853ee2a 100644 --- a/server/modules/ServerBootstrapper.js +++ b/server/modules/ServerBootstrapper.js @@ -56,9 +56,9 @@ const ServerBootstrapper = { } else { logger.warn('starting main in PRODUCTION mode. This should not be used for local development.'); main = http.createServer(app); - app.use(function(req,res,next) { + app.use(function (req, res, next) { const schema = (req.headers['x-forwarded-proto'] || '').toLowerCase(); - if (!req.path.includes('/_ah/start') && req.headers.host.indexOf('localhost')<0 && schema!=='https') { + if (!req.path.includes('/_ah/start') && req.headers.host.indexOf('localhost') < 0 && schema !== 'https') { res.redirect('https://' + req.headers.host + req.url); } else { next();