title: express middleware after response
body: <p>I've had a problem with middleware function which is launching on finish execution of main function from endpoint. Here is my middleware:</p>
  <pre><code>export const someMiddleware = async (
      req: Request,
      res: Response,
      next: NextFunction
  ) =&gt; {
      res.on(&quot;finish&quot;, () =&gt; {
          //here
      })
      next();
  }
  </code></pre>
  <p>I am having trouble getting the data that was sent to the client from the request handled by this middleware, can anyone tell me how to get the response body that is sent to the client inside the <code>on ()</code> callback?</p>
  <p>Thanks for any help!</p>