3 var express
= require('express');
4 var isPhoneMiddleware
= require('../web/middlewares/is-phone');
5 var groupContextResolverMiddleware
= require('./uri-context/group-context-resolver-middleware');
6 var featureToggles
= require('../web/middlewares/feature-toggles');
7 var identifyRoute
= require('gitter-web-env').middlewares
.identifyRoute
;
8 var redirectErrorMiddleware
= require('./uri-context/redirect-error-middleware');
9 var preventClickjackingMiddleware
= require('../web/middlewares/prevent-clickjacking');
10 var preventClickjackingOnlyGitterEmbedMiddleware
= require('../web/middlewares/prevent-clickjacking-only-gitter-embed');
11 var router
= express
.Router({ caseSensitive
: true, mergeParams
: true });
14 * These routes are deprecated. Use `group.homeUri` instead.
18 identifyRoute('group-rooms-mainframe'),
19 preventClickjackingMiddleware
,
22 groupContextResolverMiddleware
,
23 function(req
, res
, next
) {
24 var uriContext
= req
.uriContext
;
25 var group
= uriContext
&& uriContext
.group
;
26 var homeUri
= group
&& group
.homeUri
;
29 res
.relativeRedirect('/' + homeUri
);
34 redirectErrorMiddleware
38 '/:groupUri/rooms/~iframe',
39 identifyRoute('group-rooms-frame'),
40 preventClickjackingOnlyGitterEmbedMiddleware
,
43 groupContextResolverMiddleware
,
44 function(req
, res
, next
) {
45 var uriContext
= req
.uriContext
;
46 var group
= uriContext
&& uriContext
.group
;
47 var homeUri
= group
&& group
.homeUri
;
50 res
.relativeRedirect('/' + homeUri
+ '/~iframe');
55 redirectErrorMiddleware
58 module
.exports
= router
;