Files
server/SpellChecker/node_modules/express/lib/middleware/query.js
Alexander.Trofimov 3a3dfeb444 add unversion files
git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/nodeJSProjects@59172 954022d7-b5bf-4e40-9824-e11837661b57
2016-05-18 10:36:41 +03:00

31 lines
506 B
JavaScript

/**
* Module dependencies.
*/
var parseUrl = require('parseurl');
var qs = require('qs');
/**
* @param {Object} options
* @return {Function}
* @api public
*/
module.exports = function query(options) {
var queryparse = qs.parse;
if (typeof options === 'function') {
queryparse = options;
options = undefined;
}
return function query(req, res, next){
if (!req.query) {
var val = parseUrl(req).query;
req.query = queryparse(val, options);
}
next();
};
};