title: how to redirect a page in nodejs
body: <p>Currently this doesnt work. I'm new to nodejs so maybe the format is completely wrong</p>
  
  <pre><code>function blueScreen(showit) {
     console.log(showit);
     if (showit) {
        function getFormattedUrl(req) {
           return url.format({
             protocol: req.protocol,
             host: req.get('localhost:3000/blue.html')
           });
        }
     }
     return res.redirect(getFormattedUrl(req));;
  }
  </code></pre>
  
  <p>I do know this goes into this function but the screen wont change when showIt is true
  UPDATE: the res.redirect i believe is wrong because i never defined rec anyway. However I will say that this is not in the same file the app is due to the way my files interact it cant be in that file. Is there a way I can redirect my screen in a file without req and res function?</p>