Node.js
/Intermediate
HTTP Module
Definition
The foundational core module that allows Node.js to transfer data over the Hyper Text Transfer Protocol (HTTP). It enables Node to act as either an HTTP Server (listening for requests) or an HTTP Client (making requests).
Explain Like I'm New
This is the beating heart of Node web servers. It is the raw machinery that listens to port 3000, receives incoming network requests from browsers, and sends HTML or JSON back. However, it is very low-level and bare-bones, which is why almost everyone uses the `Express.js` framework to wrap it and make it easier to use.
Real World Example
Creating a lightning-fast microservice with zero external dependencies to just return a JSON response.
Common Use Cases
- •Building web servers from scratch
- •Creating reverse proxies
- •Low-level network interception
Interactive Example
Loading...
Console output will appear here...
Interview Questions
basic
- What method is used to create a new server?
intermediate
- What two objects are passed into the `createServer` callback function?
advanced
- Why do people use Express instead of the built-in HTTP module?