title: NodeJS - how to access scoped variables from eventListener
body: <p>I'm very new to <code>NodeJS</code> and web development.
  I'm using an express web server and the requester.on is a <code>ZMQ listener</code>.</p>
  
  <p>How can I access the respective res object of the respective app.post() methods ? I tried it by moving the requester.on-listener into any app.post methods but it caused bad side effects.</p>
  
  <pre><code>app.post("/first", function (req, res) {
      var reqStringFirst
      requester.send(reqString);
      //the app gets a response immediately after the send() call
  });
  
  app.post("/second", function (req, res) {
      var reqStringSecond
      requester.send(reqString);
      //the app gets a response immediately after the send() call
  });
  
  requester.on("message", function (reply) {
      var replyJSON = new TextDecoder("utf-8").decode(reply);
  
      // and here I want to use the respective res 
      // object to render different pages depending on the replyJSON content. 
  
      //like this line:
      res.render("pages/serviceDetails", {replyJSON});
  });
  </code></pre>
  
  <p>kindest regards</p>