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#
| # | Fichier | Sujet |
|---|---|---|
| 01 | 01-stack-edge.md | Stack Vercel Edge Functions, runtime: "edge", Upstash Redis, otplib. |
| 02 | 02-otp-endpoint.md | GET /api/otp — génération + Redis SET + free payload. |
| 03 | 03-otp-history.md | GET /api/otp-history — SCAN Redis + retour de tous les events. |
| 04 | 04-corsicadex.md | GET /api/corsicadex?id=N — lookup statique. |
| 05 | 05-is-authorized.md | isAuthorized.ts — x-api-key vs apiKey query param. |
| 06 | 06-redis-upstash.md | lib/redis.ts — config Upstash. |
| 07 | 07-otp-coordination-flow.md | Le 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.jsonetvercel.json.
L’objectif : être déployable en 30 secondes par un humain.