aboutsummaryrefslogtreecommitdiff
path: root/routes/index.js
blob: 8b31ad53b1881352ff4e90b72e06c492fd708852 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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) {
  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