handleQueryMiddleware
This commit is contained in:
parent
e145a631c1
commit
0a5fc471c1
8
app/middlewares/handle-query.js
Normal file
8
app/middlewares/handle-query.js
Normal 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();
|
||||
};
|
||||
};
|
Loading…
Reference in New Issue
Block a user