title: get user agent from inside jade
body: <p>I am trying to port a script I wrote for groovy over to jade, and have run into a stumbling block</p>
  
  <p>I need to access the user-agent from inside a jade file. Here is what I have tried so far:</p>
  
  <pre><code> - var agent = req.headers['user-agent'];
   - var agent = headers['user-agent'];
   - var agent = navigator.userAgent;
  </code></pre>
  
  <p>every time I get a 500 error from express. Is this even possible? </p>
  
  <p>I know I could do it in a module and pass it to the render statement, but that would mean passing it to EVERY render, as it needs to be global.</p>
  
  <p>Very new to node, and confused. Thanks SO.</p>