title: Can I only accept traffic from certain requesting domains with Expressjs?
body: <p>I would like to be able to only let requests from a very specific domain get successfully served by a node app I have on heroku.</p>
  
  <p>The code I tried is</p>
  
  <pre><code>app.use((req, res, next) =&gt; {
    if (req.hostname === "example.com") {
      next();
      }
  });
  </code></pre>
  
  <p>Turns out req.hostname seems to be the name of my heroku appserver... I've looked over the express docs for the <code>req</code> object but don't see anything else promising. </p>
  
  <p>(I see IP is a possibility but the IP situation for where the traffic is coming from changes from time to time and I'm not in the loop on that.)</p>
  
  <p>I feel like the domain of the request has to be somewhere... But maybe what I want isn't possible.</p>