aboutsummaryrefslogtreecommitdiff
path: root/routes/index.js
blob: d1f776513c45d36d88a18ff8e4dc2f6068557f90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
'use strict'

const express = require('express')
const router = express.Router()
const users = require('../lib/getUserIndex')

/* GET home page. */
router.get(['/', '/s/*', '/t/*', '/r/*', '/c/*'], function (req, res, next) {
  let flags = []
  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 })
})

module.exports = router