handleQueryMiddleware

This commit is contained in:
Simon Martín 2019-02-26 14:36:11 +01:00
parent e145a631c1
commit 0a5fc471c1

View File

@ -0,0 +1,8 @@
'use strict';
module.exports = function handleQuery () {
return function handleQueryMiddleware (req, res, next) {
res.locals.q = (req.body && req.body.q) || (req.query && req.query.q)
return next();
};
};