Node.js & REST APIs
The route
- 110 minDesign resources and errors first
URLs, status codes and error shapes, decided before a handler is written.
You board here - 110 minThe request path
Routing, middleware and validation, and which concern belongs where.
- 110 minData, migrations and transactions
Schema changes you can run on a Friday, and the transaction boundary that saves you.
- 110 minAuth without hand-waving
Sessions versus tokens, hashing, and the parts you must never invent yourself.
- 110 minWhen it goes wrong at 2am
Structured logs, metrics, timeouts, retries and idempotency.
- 110 minDeploying, and the first week after
Config, health checks, and what is actually worth watching.
A look at the teaching
Decide the error shape before the first handler exists.
// One shape for every failure, so a client needs one code path.
type ApiError = {
error: { code: string; message: string; field?: string };
};
// 409, not 400: the request was valid, the world disagreed.
if (await orders.exists(courseId, userId)) {
return json<ApiError>(
{ error: { code: "already_owned", message: "You already own this course." } },
{ status: 409 },
);
}
Pick the status from what actually happened rather than from habit. 400 means you sent me nonsense; 409 means you sent me something reasonable that conflicts with reality.
Who is driving
Dávid teaches the way a good colleague explains things at a whiteboard — no jargon for its own sake, and nothing hidden behind “as you can see”.
Placeholder profile