The http module

The node:http module lets you create an HTTP server and make requests, with little abstraction: a function receives the request and response, you set the status code and headers, then finish with res.end(). Frameworks like Express are built on it.

Example

http.createServer((req, res) => {
  res.writeHead(200, { 'Content-Type': 'text/plain' });
  res.end('Hello');
}).listen(3000);

Related concepts

The whole glossary