title: Cannot read property 'send' of undefined
body: <p>I'm trying to send data to the router from an external script and it returns the error <code>TypeError: Cannot read property 'send' of undefined</code></p>
  
  <p>Here is the code</p>
  
  <p><strong>app.js</strong></p>
  
  <pre><code>var Cake = require('./modules/cake');
  
  router.get('/cakes', function(req, res) {
    Cake.getCake();
  })
  </code></pre>
  
  <p><strong>cake.js</strong></p>
  
  <pre><code>module.exports = {
    getCake: function (req, res) {
      request({
        url: "http://get.cakes/json",
        json: true
      }, function (error, response, body) {
        if (!error &amp;&amp; response.statusCode == 200) {
          res.send(body);
        }
      });
    }
  };
  </code></pre>
  
  <p>Take note that <code>http://get.cake/</code> isn't a real site. It's irrelevent to the question.</p>