aboutsummaryrefslogtreecommitdiff
path: root/routes/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'routes/index.js')
-rw-r--r--routes/index.js31
1 files changed, 0 insertions, 31 deletions
diff --git a/routes/index.js b/routes/index.js
deleted file mode 100644
index d2267ba..0000000
--- a/routes/index.js
+++ /dev/null
@@ -1,31 +0,0 @@
-'use strict'
-
-const express = require('express')
-const router = express.Router()
-const getMeetingpointData = require('../lib/getMeetingpointData')
-
-/* GET home page. */
-router.get(['/', '/s/*', '/t/*', '/r/*', '/c/*'], function (req, res, next) {
- getMeetingpointData().then(data => {
- const isBeta = process.env.BETA === '1'
-
- let flags = []
- 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(data.users)};`
- const validWeekNumbersStr = `var VALID_WEEK_NUMBERS = ${JSON.stringify(data.validWeekNumbers)}`
-
- res.render('index', { flagsStr, usersStr, validWeekNumbersStr })
- }).catch(function () {
- console.error('Unable to get user info, emergency redirect!')
- res.render('redirect')
- })
-})
-
-module.exports = router