Node.js
Node.js HTTP ModuleNode.js HTTP Module
Node.js creates web servers that listen for requests.
Read Time
5 min readDifficulty
BeginnerLast Updated
Jun 15, 2026Version
v1.0.0Introduction
Node.js has a built-in HTTP module that transforms your computer into a live web server. The server listens on a specific port and sends text or HTML data back whenever a user tries to load the web page.
Example
Example
Key Points
- Import the module using `require('http')`.
- The `createServer()` method builds the server.
- The `listen()` method chooses the network port.
- The server responds to incoming client requests.