Skip to content
One-time payment11h · 61 lessons

Node.js & REST APIs

The route

  1. Design resources and errors first

    URLs, status codes and error shapes, decided before a handler is written.

    You board here
    110 min
  2. The request path

    Routing, middleware and validation, and which concern belongs where.

    110 min
  3. Data, migrations and transactions

    Schema changes you can run on a Friday, and the transaction boundary that saves you.

    110 min
  4. Auth without hand-waving

    Sessions versus tokens, hashing, and the parts you must never invent yourself.

    110 min
  5. When it goes wrong at 2am

    Structured logs, metrics, timeouts, retries and idempotency.

    110 min
  6. Deploying, and the first week after

    Config, health checks, and what is actually worth watching.

    110 min

A look at the teaching

Stop 1 · Design resources and errors firstSample excerpt

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

DM
Dávid Marton
Platform engineer, ex-fintech

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