node.js - NodeJS and Express interceptors -


i'm trying code interceptor metrologie purpose. interceptor must called before http query (and before express job) put time informations , after express's job duration of call.

i'm trying middleware , it's working fine "before" call not "after" call cause when route found, propagation through other middleware stopped.

please provide clues interceptors working in cases.

edit :

what i'm trying have sort of aop javascript in fact...

the 'before' interceptor middleware :

// jmc add metrologie informations route called     app.use(function (req, res, next) {         var name = req.originalmethod + req.originalurl;         log.trace('start metroinfo route : %s', name);         metro.startmetrologie(name);         return next();     }); 

thank's in advance.

if need intercept response consider middleware express-interceptor it's quite easy use , enable respond requests usual.


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -