HTTP Module in Node.js — a practical guide to Node.js http module with clear examples you can reuse in real projects.
HTTP Module in Node.js — 21/55 in the Node.js series. Full playlist companion: Node.js complete course on YouTube. Prefer one article? Read the complete Node.js tutorial.
Short description
The `http` core module can create servers without Express. It is the foundation for understanding how Node handles requests and responses.
Minimal HTTP server
const http = require('http');
const server = http.createServer((req, res) => {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('Hello from Node HTTP server');
});
server.listen(3000, () => console.log('http://localhost:3000'));