You don’t need to listen to any events. Just make it
function modify(req, res, next){
res.body = res.body + "modified";
next();
}
And use
it after you use
the router. This way after all your routes have executed you can modify the body
You don’t need to listen to any events. Just make it
function modify(req, res, next){
res.body = res.body + "modified";
next();
}
And use
it after you use
the router. This way after all your routes have executed you can modify the body