title: Passing a value to a Node js module for Express routes
body: <p>I want to pass the environment for Express to a routing module for Express. I want to key off of whether Express is running in development or production mode. To do so, I'm guessing I need to pass app.settings.env somehow to a routing module. </p>
  
  <p>My routing module exports a function for each route. So:</p>
  
  <pre><code>app.get('/search', web.search);
  </code></pre>
  
  <p>Based upon a previous stackoverflow post, i have tried this:</p>
  
  <pre><code>var web = require('./web')({'mode': app.settings.env});
  </code></pre>
  
  <p>But node throws an type error (object is not a function).</p>
  
  <p>I'm new to Node and Express. Can I pass a value to an express route and if so, how?</p>