title: localhost didn't send any data - ERR_EMPTY_RESPONSE
body: <p>Using VScode to write NodeJS</p>
  
  <p>But to check, localhost isn't responding properly, it says "the page didn't send any data.
  I tried looking everywhere and changed all the possible settings I can.</p>
  
  <p>restored chrome settings
  cleared cache, cleared history, changed port numbers, changed LAN settings.</p>
  
  <pre><code> ''''
  
  const Joi = require('joi');
  const express = require('express');
  const app = express();
  
  app.use(express.json); //to take inputs ffrom the browser
  const courses = [
  {id: 1, name: "course 1"},
  {id: 2, name: "course 2"},
  {id: 3, name: "course 3"},
   ];
  
  app.get('/', (req, res) =&gt;{
  res.send("Hello world!!");
  res.end();
  });
  
  app.get('/api/courses/', (req, res) =&gt;{
  res.send(courses);
  res.end();
  });
  
  const port = process.env.port || 8080;
  app.listen(port, ()=&gt; console.log(`Listining on port ${port}..`));
  
   ''''
  </code></pre>
  
  <p>Want to see all the courses printed on the webpage.</p>