title: Node.js + Express: Trying to Properly Display GET Request Headers
body: <p>I'm currently trying to write-up a simple echo server app that echoes back the the request headers when the server receives a GET request. It should look something like this:</p>
  <p><a href="https://i.stack.imgur.com/OJsHp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OJsHp.png" alt="Echo Server" /></a></p>
  <p>Here is my routing code for the request:</p>
  <pre><code>app.get('/', function(req,res){
  var s = '';
  for(var name in req.headers) s += name + ': ' + req.headers[name] + '\n';
  res.render('home', {output: s})});
  </code></pre>
  <p>It results in this response:</p>
  <p><a href="https://i.stack.imgur.com/hO3yB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hO3yB.png" alt="enter image description here" /></a></p>
  <p>It seems that my newline character is not working as intended. I'm sure it's some silly mistake but I can't seem to figure it out.</p>