Concept
An HTTP request has a method, a path, headers and sometimes a body; the response has a status, headers and a body. Everything a web framework does is a convenience around reading one and writing the other.
The tutor works through these with you, in conversation and code. A session ends when you have shown them, not when a video does.
A few lines that show Requests and responses doing its job.
import { createServer } from "node:http";
createServer((req, res) => {
if (req.method === "GET" && req.url === "/health") {
res.writeHead(200, { "content-type": "application/json" });
res.end(JSON.stringify({ ok: true }));
return;
}
res.writeHead(404).end();
}).listen(3000);Forgetting to end the response on some code path. The client waits until it times out, and the connection is held open; every branch must send a response.
Your roadmap puts these before Requests and responses, unless you already know them.
Once a session shows you understand Requests and responses, it comes back for review. Each review takes a minute and tells the memory model how well you still know it.
Topics that build on Requests and responses.