mirror of
https://github.com/arnaucube/raspberryGPIOhtmlserver.git
synced 2026-02-08 12:16:42 +01:00
servidor funciona, gpio desabilitat
This commit is contained in:
46
node_modules/connect/lib/middleware/query.js
generated
vendored
Executable file
46
node_modules/connect/lib/middleware/query.js
generated
vendored
Executable file
@@ -0,0 +1,46 @@
|
||||
/*!
|
||||
* Connect - query
|
||||
* Copyright(c) 2011 TJ Holowaychuk
|
||||
* Copyright(c) 2011 Sencha Inc.
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
var qs = require('qs')
|
||||
, parse = require('../utils').parseUrl;
|
||||
|
||||
/**
|
||||
* Query:
|
||||
*
|
||||
* Automatically parse the query-string when available,
|
||||
* populating the `req.query` object.
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* connect()
|
||||
* .use(connect.query())
|
||||
* .use(function(req, res){
|
||||
* res.end(JSON.stringify(req.query));
|
||||
* });
|
||||
*
|
||||
* The `options` passed are provided to qs.parse function.
|
||||
*
|
||||
* @param {Object} options
|
||||
* @return {Function}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
module.exports = function query(options){
|
||||
return function query(req, res, next){
|
||||
if (!req.query) {
|
||||
req.query = ~req.url.indexOf('?')
|
||||
? qs.parse(parse(req).query, options)
|
||||
: {};
|
||||
}
|
||||
|
||||
next();
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user