title: Pass configuration to controller
body: <p>I am building a node.js app that will upload files to my S3 bucket using knox.  I am able to interact with S3 as expected, but I would like to make my controller to receive configuration so I can dynamically construct my client with configuration values.</p>
  
  <p>My questions is how do I get configuration paramters down the call stack to my controller without being careless?  </p>
  
  <p><em>Disclaimer: I am rather new to Node.js so it could be simply my lack of knowledge in the difference between exports.</em> and module.exports.*</p>
  
  <p>Here is an example of how the interaction works with my code:</p>
  
  <p><strong>app.js</strong></p>
  
  <pre><code>...
  config = require('./config/config')['env'];
  require('./config/router')(app, config);
  ...
  </code></pre>
  
  <p><strong>router.js</strong></p>
  
  <pre><code>module.exports = function(app, config) {
  ...
    var controller = require('../app/controllers/home'); //Is there a way for me to pass config here?
    app.post('/upload', controller.upload); //Or here?
  ...
  }
  </code></pre>
  
  <p><strong>home.js</strong></p>
  
  <pre><code>var knox = require('knox');
  
  var client = knox.createClient({ ... }); //I want to use config.key, config.secret, etc instead of hard-coded values
  ...
  exports.upload = function(req, res) {
    //Use client
  }
  ...
  </code></pre>