[PK-57] BE: pridanie CORS middleware pre /api/* #17
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "agent/be-dev/225e8d69"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fix pre PK-57 — BE-side CORS middleware (variant A z tech-lead návrhu) pre /api/*.
Zmeny
be/middleware.ts— Next.js middleware smatcher: [/api/:path*], OPTIONS preflight → 204 s CORS hlavičkami.be/lib/cors.ts— allow-list cez envCORS_ALLOWED_ORIGINS(comma-separated; defaulthttp://localhost:3000).be/.env.example, root.env.example,docker-compose.yml— pridanáCORS_ALLOWED_ORIGINS.be/tests/cors.test.ts— 11 testov (preflight, allow-listed, odmietnutý, no-Origin, multi-origin).be/README.md— sekcia CORS.Overenie
npm test→ 196/196 passed.AC schválené tech-leadom.