title: How to pass app = express() into another module?
body: <p>I'm working on a basic Node app, I have app.js which requires most of my dependencies, then I have another module which just require <code>http</code> and <code>url</code>.</p>
  
  <p>However in this other module I need to pass my express app into it, because I'd rather not have to set var app = express() again inside the sub module.</p>
  
  <p>How would you pass app into my get_twitter.js?</p>
  
  <p>Main app.js</p>
  
  <pre><code>var express     = require('express');
  var app         = express();
  var hello       = require('./custom_hello');
  var gettwitter  = require('./get_twitter');
  
  hello();
  
  app.get('/', function(request, response) {
      response.sendFile(__dirname + "/index.html");
  });
  
  app.gettwitter();
  
  app.listen(9000);
  console.log('listening on 9000...');
  </code></pre>
  
  <p>get_twitter module:</p>
  
  <pre><code>/* =========================================
  GET TWITTER Node module
  ========================================= */
  
  var http = require('http');
  var url  = require('url');
  
  app.get('/tweets/:username', function(req, response) {
  
      var username = req.params.username;
  
      options = {
          protocol: "http:",
          host: "api.twitter.com",
          pathname: "/1/statuses/user_timeline.json",
          query: { screen_name: username, count: 10 }
      }
  
      var twitterUrl = url.format(options);
      request(twitterUrl).pipe(response);
  
  });
  </code></pre>
  
  <p>Currently if I run this as is, <code>app</code> will of course throw the <strong>ReferenceError: app is not defined error</strong>.</p>