diff options
Diffstat (limited to 'routes/index.js')
-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..d2267ba 100644 --- a/routes/index.js +++ b/routes/index.js @@ -5,20 +5,25 @@ const router = express.Router() const getMeetingpointData = require('../lib/getMeetingpointData') /* GET home page. */ -router.get('/', function (req, res, next) { +router.get(['/', '/s/*', '/t/*', '/r/*', '/c/*'], function (req, res, next) { getMeetingpointData().then(data => { + const isBeta = process.env.BETA === '1' + let flags = [] - if (req.query.nfd != null) { + if (isBeta) { + flags.push('BETA') + flags.push('NO_FEATURE_DETECT') + } else if (req.query.nfd != null) { flags.push('NO_FEATURE_DETECT') } 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 }) }).catch(function () { console.error('Unable to get user info, emergency redirect!') - // res.redirect('http://www.meetingpointmco.nl/Roosters-AL/doc/') res.render('redirect') }) }) |