Using Express, how can I determine the response has been sent / that the response has been completely written to?
app.use((req,res,next) => {
if(res.ended){
//
}
if(res.finished){
//
}
});
how can I tell if res.end()
has been called? I am looking for a boolean I can read on res.
next()
after you callres.send()
so a middleware like you show above that you put at the end of the middleware chain would never get called. – Autosome