title: Why is my http://localhost:8080 not loading in node.js on mac
body: <p>So I am very new to node.js and I am on a mac. I am learning from W3schools and I have to run myfirst.js in the local host but I keep getting this error:</p>
  <p>This page isn’t working localhost didn’t send any data.
  ERR_EMPTY_RESPONSE</p>
  <p>here is the code:</p>
  <pre><code>const https = require('https');
  https.createServer(function (req,res){
     res.writeHead(200, {'content-type':'text/html'});
    res.send('Hello world!');
  }).listen(8080);
  </code></pre>
  <p>and I ran this code in the terminal:</p>
  <p>Macs-MBP:~ mac$ node /Users/mac/test/myfirst.js</p>
  <p>the terminal command works but when i go to my browser and run :http://localhost:8080</p>
  <p>I just keep getting the above error</p>
  <p>how would I fix this?</p>