aboutsummaryrefslogtreecommitdiff
path: root/routes/index.js
blob: bc0a93637454d77956f57f465f6da4fdd265873b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
const express = require('express')
const router = express.Router()
const users = require('../lib/getUserIndex')

/* GET home page. */
router.get('/', function (req, res, next) {
  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