Node.js FAQ: Top Questions
10. What is the http module in Node.js?
The http module is a built-in Node.js module for creating HTTP servers and clients, enabling web server functionality without external frameworks.
-
Server:
Created with
http.createServer. -
Client:
Make requests with
http.requestorhttp.get. -
Request/Response:
Handles
req(request) andres(response) objects. - Use Case: Building lightweight web servers or APIs.
