diff options
author | Noah Loomans <noahloomans@gmail.com> | 2018-07-31 15:23:53 +0200 |
---|---|---|
committer | Noah Loomans <noahloomans@gmail.com> | 2018-07-31 15:23:53 +0200 |
commit | a9c832b003daa70ee78cacecc518cebdf4071ca1 (patch) | |
tree | 75978d446f22730fc859a24e999108ebdd461359 /routes | |
parent | 614817541a79ec0bbc90f8d6133db408b95dac35 (diff) |
Add MAVO version
Diffstat (limited to 'routes')
-rw-r--r-- | routes/index.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/routes/index.js b/routes/index.js index d496b3c..223d97f 100644 --- a/routes/index.js +++ b/routes/index.js @@ -6,6 +6,10 @@ const getMeetingpointData = require('../lib/getMeetingpointData') /* GET home page. */ router.get('/', function (req, res, next) { + const baseMeetingpointUrl = process.env.SCHOOL_LEVEL === 'mavo' + ? 'http://www.meetingpointmco.nl/Roosters-AL/TOSweb' + : 'http://www.meetingpointmco.nl/Roosters-AL/doc'; + getMeetingpointData().then(data => { let flags = [] if (req.query.nfd != null) { @@ -15,11 +19,12 @@ router.get('/', function (req, res, next) { const flagsStr = `var FLAGS = ${JSON.stringify(flags)};` const usersStr = `var USERS = ${JSON.stringify(data.users)};` const validWeekNumbersStr = `var VALID_WEEK_NUMBERS = ${JSON.stringify(data.validWeekNumbers)}` - res.render('index', { flagsStr, usersStr, validWeekNumbersStr }) + res.render('index', { baseMeetingpointUrl, 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') + res.render('redirect', { + baseMeetingpointUrl, + }) }) }) |