3 var roomContextService
= require('gitter-web-rooms/lib/room-context-service');
4 var debug
= require('debug')('gitter:app:group-context-resolver-middleware');
6 function groupContextResolverMiddleware(req
, res
, next
) {
7 var uri
= req
.params
.groupUri
;
8 debug('Looking up normalised uri %s', uri
);
10 return roomContextService
11 .findContextForGroup(req
.user
, uri
)
12 .then(function(uriContext
) {
13 req
.group
= uriContext
.group
;
14 req
.uriContext
= uriContext
;
19 module
.exports
= groupContextResolverMiddleware
;