title: Why is the Node.js javascript function res.write(data) outputting numbers when I log it?
body: <p>I'm using Node.js on my Raspberry Pi to read a local file 'test.html' and when I log the output it looks like it's hex and not the html.  Why is this?  Also, I understand fs.readFile is for local files only.  What would I use to read a URI like, 'myzone.example.com/test.html' ? (Thanks in advance for any assistance.)</p>
  <pre><code>function handler (req, res) { //create server
    fs.readFile('../Public/test.html', function(err, data) { //read file index.html in public folder
      if (err) {
        res.writeHead(404, {'Content-Type': 'text/html'}); //display 404 on error
        console.log(err);
        return res.end(&quot;404 Not Found at Arcade.&quot;);
      }
      res.writeHead(200, {'Content-Type': 'text/html'}); 
      res.write(data); 
      console.log(&quot;Page Data: &quot;, data);
      return res.end();
    });
  }
  </code></pre>
  <p>Console.log output:</p>
  <p>Page Data:  &lt;Buffer 3c 21 64 6f 63 74 79 70 65 20 68 74 6d 6c 3e 0a 3c 68 74 6d 6c 3e 0a 3c 68 65 61 64 3e 0a 3c 74 69 74 6c 65 3e 4d 79 20 48 54 4d 4c 20 50 61 67 65 3c ... 69 more bytes&gt;</p>