阅读背景:

如何在node.js+express中捕获“响应结束”事件?

来源:互联网 

I'd like to write an express middleware function that sets up a listener on the response's 'end' event, if one exists. The purpose is to do cleanup based on the http response code that the end handler decided to send, e.g. logging the response code and rollback/commit of a db transaction. i.e., I want this cleanup to be transparent to the end caller.I'd like to write an express middleware functio




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: