title: trying to understand how html GET and res.redirect works in express
body: <p>I am new to nodejs express et al..I am trying to understand why a res.redirect needs a GET to work..whereas a res.render don't. Here is the scenario. I have a login that uses passport for authentication with a database..good so far. After authentication depending on the type of user....the user is sent to a particular html page. If I just res.render the page it works fine....but if I res.redirect to the page I get a "Cannot GET..." error indicating I did't  have get('/page') block. Here is a sample code:</p>
  
  <pre><code>// get part request page
    router.get('/partpage', function(req,res) {
    res.render('partpage', {name: user.get("Name"),email:user.get("Email")});
  
  });
  // get dealer page
    router.get('/dealers', function(req,res) {
    res.render('dealers', {name: user.get("Name"),email:user.get("Email")});
  
  });
  
  .
  .
  .
  router.post('/login',
   passport.authenticate( 'local',
      {sucessRedirect:'/',
       failureRedirect:'/users/login',
       failureFlash:true}),
   function(req,res)
   {
  .
  .
  .
  
  // After passport authentication.....
  
   if (user.get("Category")==="dealer")
       {
         res.redirect('/users/dealers?name='+username+'&amp;email='+useremail);
       }
    else
       {
        res.redirect('/users/partpage?name='+username+'&amp;email='+useremail);
       }
  </code></pre>
  
  <p>If I remove any one of the GET I get and error('Cannot GET...'). I don't understand why this is the case. More importantly I am passing parameters to the page...which one takes precedence? ...obviously something is wrong here! can anyone explain this for me? what is the correct way to to this?</p>
  
  <p>The home page route is setup as follows:</p>
  
  <p>in app.js</p>
  
  <pre><code>.
  .
  .
  var routes = require('./routes/index');
  .
  .
  .
  app.set('views', path.join(__dirname,'views'));
  app.set('view options', { layout:'layout.ejs' });
  app.set('view engine','ejs');
  .
  .
  .
  app.use('/', routes);
  </code></pre>