Part 3 — Express + MongoDB
FSO jumps straight into Express without showing what Express abstracts away.
Building a server with only Node's built-in http module gives you
an appreciation for routing, request parsing, response headers, and content types.
This is the "do it the hard way once" project. It's short — a day or two — but
it permanently changes how you understand Express.
A URL shortener API using only node:http — no Express, no frameworks.
POST a long URL, get back a short code. GET the short code, get redirected. Store
mappings in a JSON file on disk. Track how many times each short link has been visited.
Serve a basic HTML page at the root that shows all shortened URLs and their click counts.
node:http, node:fs, node:url, node:crypto — no npm packagesContent-Type headers (application/json, text/html)db.json file using fs.readFile / fs.writeFilereq.body, no
app.get(), no middleware. After this project, you'll understand every
convenience Express gives you.