Add zone middleware
This commit is contained in:
parent
5aa8b369b4
commit
100204e6d4
|
@ -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');
|
||||
});
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue