diff --git a/backend.js b/backend.js index 8e379b5..6cf3a73 100644 --- a/backend.js +++ b/backend.js @@ -11,6 +11,15 @@ const io = new Server(server, { pingTimeout:5000 }) +app.use(requireHTTPS); + +function requireHTTPS(req, res, next) { + // The 'x-forwarded-proto' check is for Heroku + if (!req.secure && req.get('x-forwarded-proto') !== 'https' && process.env.NODE_ENV !== "development") { + return res.redirect('https://' + req.get('host') + req.url); + } + next(); + } // const port = 3000 app.use(express.static('public')) diff --git a/public/ghost2.png b/public/ghost2.png new file mode 100644 index 0000000..f020105 Binary files /dev/null and b/public/ghost2.png differ diff --git a/public/index.js b/public/index.js index f5796b7..27b3f3e 100644 --- a/public/index.js +++ b/public/index.js @@ -16,7 +16,7 @@ let row = 0; let readyNow = false let animationFrame = 0; let pageVisible = true; -let debugMode = true; +let debugMode = false; let timeoutHandle; // let atPosition = true;