3 var express = require('express');
4 var ensureLoggedIn = require('../web/middlewares/ensure-logged-in');
5 var timezoneMiddleware = require('../web/middlewares/timezone');
6 var isPhoneMiddleware = require('../web/middlewares/is-phone');
7 var featureToggles = require('../web/middlewares/feature-toggles');
8 var userHomeRenderer = require('./renderers/userhome');
9 const exploreRenderer = require('./renderers/explore-renderer');
10 var identifyRoute = require('gitter-web-env').middlewares.identifyRoute;
11 var preventClickjackingMiddleware = require('../web/middlewares/prevent-clickjacking');
13 var router = express.Router({ caseSensitive: true, mergeParams: true });
17 identifyRoute('home-main'),
19 preventClickjackingMiddleware,
22 function(req, res, next) {
23 userHomeRenderer.renderHomePage(req, res, next);
27 // Used for the create button on `/home`
30 identifyRoute('create-room-redirect'),
32 preventClickjackingMiddleware,
35 res.redirect('/home#createroom');
40 new RegExp('/explore(.*)?'),
41 identifyRoute('home-explore'),
42 preventClickjackingMiddleware,
47 return exploreRenderer.renderExplorePage(req, res);
49 return res.redirect('/explore');
54 // FIXME: Remove after 2020-8-22
57 identifyRoute('home-learn-main'),
59 preventClickjackingMiddleware,
63 return res.redirect('/home');
67 module.exports = router;