res.locals forgotten things and make jshint happy
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
const _ = require('underscore');
|
||||
|
||||
module.exports = function authorizeMiddleware (authApi) {
|
||||
return function (req, res, next) {
|
||||
req.profiler.done('req2params.setup');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const locals = require('./locals')
|
||||
const locals = require('./locals');
|
||||
const cleanUpQueryParams = require('./clean-up-query-params');
|
||||
const layergroupToken = require('./layergroup-token');
|
||||
const authorize = require('./authorize');
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
const _ = require('underscore');
|
||||
|
||||
module.exports = function layergroupTokenMiddleware(req, res, next) {
|
||||
// FIXME: Temporary hack to share data between middlewares. Express overrides req.params to
|
||||
// parse url params to an object and it's performed after matching path and controller.
|
||||
res.locals = {};
|
||||
_.extend(res.locals, req.params);
|
||||
|
||||
next();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user