go over each line in text nodejs

const http = require('http');

const server = http.createServer((req, res) => {
  res.statusCode = 200;
  res.setHeader('Content-Type', 'text/plain');
  res.end('Hello, World!\n');
});

const PORT = 3000;
server.listen(PORT, () => {
  console.log(`Server running at http://localhost:${PORT}/`);
});
  1. Import the 'http' module.
  2. Create an HTTP server using the createServer method, which takes a callback function with request (req) and response (res) parameters.
  3. Set the HTTP status code of the response to 200.
  4. Set the 'Content-Type' header of the response to 'text/plain'.
  5. Send the 'Hello, World!\n' string as the response body.
  6. Create a constant named PORT and set its value to 3000.
  7. Make the server listen on the specified port (3000) and log a message to the console when the server is successfully running.