Add zone middleware

This commit is contained in:
Raymond Feng 2014-05-30 15:45:47 -07:00
parent 5aa8b369b4
commit 100204e6d4
1 changed files with 14 additions and 0 deletions

14
lib/middleware/zone.js Normal file
View File

@ -0,0 +1,14 @@
require('zone').enable();
module.exports = context;
function context(options) {
return function(req, res, next) {
zone.create(function RequestZone() {
zone.data.url = req.url;
next();
}).catch(function(err) {
console.error(err.zoneStack + '\n');
});
};
}