title: What is the proper usage of res.render() and res.redirect() in Express?
body: <p>I'm having some trouble deciphering the ambiguity between </p>
  
  <pre><code>res.render('viewname', {msg: 'Message' }) 
  </code></pre>
  
  <p>and</p>
  
  <pre><code>res.redirect('route')
  </code></pre>
  
  <p>The redirect function does not let you pass a "message", but you may still want to, and the render function will render your view, but it will not change the URL of your web app and will not trigger the function which is required for your route.</p>
  
  <p>The situation I am having is that I have an Invite form, which has an action that changes my URL, and triggers a function at that route which has a success and failure callback, and I would like to redirect users to the Dashboard with a message indicating success or failure. </p>