aboutsummaryrefslogtreecommitdiff
path: root/routes/index.js
diff options
context:
space:
mode:
authorNoah Loomans <noahloomans@gmail.com>2017-03-22 12:47:25 +0100
committerNoah Loomans <noahloomans@gmail.com>2017-03-22 12:47:25 +0100
commit0f77408d646590273bcadb17e12256e93fee9600 (patch)
tree469c0e70587021df9f4655ad464c9b57d191f768 /routes/index.js
parent975c3f20a32b7bdd0f263c1482deb0fba7251912 (diff)
Add BETA to the title when BETA env is set to 1
Diffstat (limited to 'routes/index.js')
-rw-r--r--routes/index.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/routes/index.js b/routes/index.js
index d1f7765..a65ac69 100644
--- a/routes/index.js
+++ b/routes/index.js
@@ -6,14 +6,20 @@ const users = require('../lib/getUserIndex')
/* GET home page. */
router.get(['/', '/s/*', '/t/*', '/r/*', '/c/*'], function (req, res, next) {
+ 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(users.users)};`
- res.render('index', { flagsStr, usersStr })
+
+ res.render('index', { flagsStr, usersStr, isBeta })
})
module.exports = router