Chapitre 06 — tests-workers, backend Vercel Edge

Chapitre 06 — tests-workers, backend Vercel Edge#

Trois endpoints HTTP, deux libs (@upstash/redis, otplib), zéro Next.js applicatif. Le strict minimum pour coordonner des tests parallèles sur l’Igoristan.

Plan#

#FichierSujet
0101-stack-edge.mdStack Vercel Edge Functions, runtime: "edge", Upstash Redis, otplib.
0202-otp-endpoint.mdGET /api/otp — génération + Redis SET + free payload.
0303-otp-history.mdGET /api/otp-history — SCAN Redis + retour de tous les events.
0404-corsicadex.mdGET /api/corsicadex?id=N — lookup statique.
0505-is-authorized.mdisAuthorized.ts — x-api-key vs apiKey query param.
0606-redis-upstash.mdlib/redis.ts — config Upstash.
0707-otp-coordination-flow.mdLe flux complet OTP : Igoristan ↔ workers ↔ Ocarina ↔ Redis.

Objectifs#

  • 3 endpoints .ts.
  • 2 fichiers lib/.
  • 1 fichier consts/.
  • Total : ~7 fichiers TypeScript de code, plus package.json et vercel.json.

L’objectif : être déployable en 30 secondes par un humain.