Answer the question
In order to leave comments, you need to log in
How to add a res.send() handler to Express.js?
I have a server written in Express.js
How can I add a handler to be called before each call to res.send()?
Something I'm confused...
Answer the question
In order to leave comments, you need to log in
Through use, rewrite the response function
app.use(function (req, res) {
var send = res.send;
res.send = function (body) {
// тут что надо делай
send.call(this, body);
};
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question