Computer scienceBackendNode.jsCore ConceptsInternal modulesHTTP serverhttp module

Introduction to the HTTP module

Create HTTP answer

Report a typo

Add one more line to the code snippet below so that it will return HTTP module is awesome!.

const http = require('node:http');

const server = http.createServer((request, response) => {
  response.writeHead(200, {'Content-Type': 'text/plain'});
  // your answer here...
  response.end();
});

server.listen(8080, () => {
  console.log('Server running on port 8080.');
});
Enter a short text
___

Create a free account to access the full topic