title: render a page in Node and change URL
body: <p>I have a login with a form that has the attribute action="api/login", after loging in, it renders a page and shows a pathname of <a href="http://localhost:3000/api/login" rel="nofollow noreferrer">http://localhost:3000/api/login</a>.  I want it to say <a href="http://localhost:3000/dashboard" rel="nofollow noreferrer">http://localhost:3000/dashboard</a>.  I tried redirecting /dashboard then rendering, but I just got a blank page.  Below is my code. I am using NodeJS, I have a route folder that calls to the Auth Controller. </p>
  
  <pre><code>//html form
  &lt;form method='post' action="api/login"&gt;
  
  //route
  router
      .route('/login')
      .post(ctrlAuth.login); 
  
  
  
  module.exports.login = function(req, res) {
  
  ////DOES AUTH CODE STUFF here//////
  
                          res
                              .status(200)
                              .render('holder', {
                                  device: req.session.device,
                                  id: req.session.id,
                                  first_name: req.session.first_name,
                                  last_name: req.session.last_name,
                                  role: req.session.role,
                                  users: user_data
                              });
                      })
  
                  })
  
  
  
              } else {
                  console.log('password incorrect')
                  res.redirect('/home')
              }
          });
      })
  
  };
  </code></pre>