How to have a NodeJS/connect middleware execute after responde.end() has been invoked?
I would like to achieve something like this: var c = require('connect'); var app = c(); app.use("/api", function(req, res, next){ console.log("request filter 1"); next(); }); app.use("/api", function(req, res, next){ console.log("request filter 2"); next(); }); app.use("/api", function(req, res, next){ console.log("request handler"); res.end("hello"); next(); }); app.use("/api", function(req, res, next){ console.log("response post processor"); next(); }); app.listen(3000); When I curl for the address, I get an exception to the console complaining about headers cannot be bothered after being