title: How to redirect to route from included files
body: <p>Im having trouble with redirecting to a different route from a required JavaScript file. As you see in oauth2.js i have a function <em>validate</em> which is called when callback from the request.post() method is called. This means I cant pass the express-instantiation (app) as a parameter. </p>
  
  <p>server.js</p>
  
  <pre><code>var app = require('express);
  var login = require('./routes/login');
  app.use('/login', login);
  
  var oauth2 = require('./oauth2');
  oauth2.auth();
  
  app.get('/login', function(req, res) {
      res.sendFile('./public/login.html', { root: __dirname });
  });
  
  app.listen(8080);
  </code></pre>
  
  <p>routes/login.js</p>
  
  <pre><code>    var express = require('express');
      var router = express.Router();
      module.exports = function (){
          router.get('/login', function(req, res){
              console.log('Logging in...');
          }
          return router;
      }
  </code></pre>
  
  <p>oauth2.js</p>
  
  <pre><code>...
  var request = require('request');
  request.post({
      uri: uri, 
      headers:headers, 
      body:data
  }, validate);
  
  function validate(err, res, body){
      ...
  
      // REDIRECT TO /login.html
  }
  </code></pre>
  
  <p>How can I redirect to /login.html from the validate method?  </p>