typestack / routing-controllers

Create structured, declarative and beautifully organized class-based controllers with heavy decorators usage in Express / Koa using TypeScript and Routing Controllers Framework.
MIT License
4.36k stars 393 forks source link

question: How to execute code after the response is sent to client #1396

Open victor-murillo-deel opened 1 month ago

victor-murillo-deel commented 1 month ago

I'd like to execute some logic after my controller returns a response. Since this logic does not impact the result, I'd like to return first, so the client can receive the response asap, and then run this additional logic Something like https://stackoverflow.com/questions/16180502/why-can-i-execute-code-after-res-send

**The problem: It's not clear to me how to achieve this with this library**