node:http

The built-in Node.js module for writing HTTP/1.1 servers and clients, which web frameworks such as Express and Fastify build on.

In more detail

createServer((req, res) => ...) calls your handler with an IncomingMessage and a ServerResponse for every request. Both are streams, so bodies can be streamed rather than held in memory.

Related terms

Taught in

References