Chapter 06 — tests-workers, Vercel Edge backend#
Three HTTP endpoints, two libs (
@upstash/redis,otplib), zero Next.js app code. The bare minimum to coordinate parallel tests against Igoristan.
Outline#
| # | File | Topic |
|---|---|---|
| 01 | 01-stack-edge.md | Stack Vercel Edge Functions, runtime: "edge", Upstash Redis, otplib. |
| 02 | 02-otp-endpoint.md | GET /api/otp — generation + Redis SET + free payload. |
| 03 | 03-otp-history.md | GET /api/otp-history — Redis SCAN + return of every event. |
| 04 | 04-corsicadex.md | GET /api/corsicadex?id=N — static lookup. |
| 05 | 05-is-authorized.md | isAuthorized.ts — x-api-key vs apiKey query param. |
| 06 | 06-redis-upstash.md | lib/redis.ts — Upstash config. |
| 07 | 07-otp-coordination-flow.md | Full OTP flow: Igoristan ↔ workers ↔ Ocarina ↔ Redis. |
Goals#
- 3
.tsendpoints. - 2
lib/files. - 1
consts/file. - Total: ~7 TypeScript code files, plus
package.jsonandvercel.json.
Goal: deployable in 30 seconds by a human.