aboutsummaryrefslogtreecommitdiff
path: root/routes/index.js
diff options
context:
space:
mode:
authorNoah Loomans <noahloomans@gmail.com>2016-12-06 15:29:43 +0100
committerNoah Loomans <noahloomans@gmail.com>2016-12-06 15:29:43 +0100
commit54b9362d9548c8137d242fe5d30b3b0bbea72189 (patch)
tree6390767aea5c1ce9349c90733fe913bad0b51f70 /routes/index.js
parent863d43f5038cd3b660c2f5160cd56124fa09427b (diff)
parent9d94ae11c13d8bcff23eac725c2d7bae2a7872a9 (diff)
Merge branch 'beta' of https://github.com/nloomans/rooster-mml into beta
Diffstat (limited to 'routes/index.js')
-rw-r--r--routes/index.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/routes/index.js b/routes/index.js
index 07192b7..8b31ad5 100644
--- a/routes/index.js
+++ b/routes/index.js
@@ -1,14 +1,18 @@
+'use strict'
+
const express = require('express')
const router = express.Router()
const users = require('../lib/getUserIndex')
/* GET home page. */
router.get('/', function (req, res, next) {
- if (req.query.v === 'n') {
- res.render('index', { version: 'new', users: users.users })
- } else {
- res.render('index', { version: 'old', users: users.users })
+ let flags = []
+ if (req.query.nfd != null) {
+ flags.push('NO_FEATURE_DETECT')
}
+
+ const flagsStr = `var FLAGS = [${flags.map(flag => `"${flag}"`).toString(', ')}];`
+ res.render('index', { flagsStr, users: users.users })
})
module.exports = router