request-properties
v1.0.3
Published
A connect/express middleware for loading request properties
Downloads
11
Readme
request-properties
npm install request-properties
Usage
var properties = require('request-properties');
app.use(properties({
someFunctionValue: function() {
return 'some value';
},
someDirectProperty: 1234,
somePromiseResponse: function(req) {
return Promise.resolve('some database response');
}
}));
app.get('/', function(req, res) {
console.log(req.someFunctionValue); // 'some value'
console.log(req.someDirectProperty); // 1234
console.log(req.somePromiseResponse); // 'some database response'
res.end();
});
Development
git clone
this repositorynpm install
Running Tests
npm run test