-1

I was learning to make a basic server in Node.js but I face this error every time I try to run my server I have provided an image of my code and an image of the error as well please help if you can

Code This is code image

Error This is error image

Suhaib Janjua
  • 3,538
  • 16
  • 59
  • 73

1 Answers1

0

The proper line of code should be:

res.writeHead(200, { "Content-type": "text/html" });

According to the error shown, it looks like you just wrote

"content type"

instead of

"Content-type"

Idan Krupnik
  • 443
  • 1
  • 6
  • 8