diff options
author | Noah Loomans <noahloomans@gmail.com> | 2017-09-08 21:44:45 +0200 |
---|---|---|
committer | Noah Loomans <noahloomans@gmail.com> | 2017-09-08 21:44:45 +0200 |
commit | 5aac32f72eca8c66e879583ce653d07bb3c7370f (patch) | |
tree | e529c41a917ce3f7f13183febc3ce666a6f627d4 /routes | |
parent | b4a63e917d8e07f0b1422f5f4e145e46e223386e (diff) | |
parent | c8d6527d802a64e19ef5e7141a9c817517d5a99f (diff) |
Merge branch 'master' into beta
Diffstat (limited to 'routes')
-rw-r--r-- | routes/index.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/routes/index.js b/routes/index.js index 3718015..d2267ba 100644 --- a/routes/index.js +++ b/routes/index.js @@ -2,11 +2,11 @@ const express = require('express') const router = express.Router() -const getUserIndex = require('../lib/getUserIndex') +const getMeetingpointData = require('../lib/getMeetingpointData') /* GET home page. */ router.get(['/', '/s/*', '/t/*', '/r/*', '/c/*'], function (req, res, next) { - getUserIndex().then(users => { + getMeetingpointData().then(data => { const isBeta = process.env.BETA === '1' let flags = [] @@ -18,12 +18,13 @@ router.get(['/', '/s/*', '/t/*', '/r/*', '/c/*'], function (req, res, next) { } const flagsStr = `var FLAGS = ${JSON.stringify(flags)};` - const usersStr = `var USERS = ${JSON.stringify(users)};` + const usersStr = `var USERS = ${JSON.stringify(data.users)};` + const validWeekNumbersStr = `var VALID_WEEK_NUMBERS = ${JSON.stringify(data.validWeekNumbers)}` - res.render('index', { flagsStr, usersStr, isBeta }) + res.render('index', { flagsStr, usersStr, validWeekNumbersStr }) }).catch(function () { console.error('Unable to get user info, emergency redirect!') - res.redirect('http://www.meetingpointmco.nl/Roosters-AL/doc/') + res.render('redirect') }) }) |