1.0.0 • Published 11 years ago
context-middleware v1.0.0
context-middleware
Attach req.context
to all express requests.
Example
var context = require('context-middleware');
var app = express();
app.use(context());
app.use('/user', function (req, res, next) {
var id = req.param('id');
users.get(id, function (err, user) {
req.context.user = user;
next();
});
});
API
context()
Generate a context middleware.
License
WWWWWW||WWWWWW
W W W||W W W
||
( OO )__________
/ | \
/o o| MIT \
\___/||_||__||_|| *
|| || || ||
_||_|| _||_||
(__|__|(__|__|
1.0.0
11 years ago