Files
John Patrick TeruelandCopilot 186cd4cc7c Add CORS support for frontend on localhost:3000
The frontend at http://localhost:3000 was getting CORS (Cross-Origin Resource Sharing)
errors when trying to make API requests to http://localhost:8000.

Added CORSMiddleware to FastAPI backend with:
- allow_origins: http://localhost:3000 and http://127.0.0.1:3000
- allow_credentials: true (for Authorization headers)
- allow_methods: all (GET, POST, OPTIONS, etc.)
- allow_headers: all (including Authorization, Content-Type, etc.)

This allows the browser to make cross-origin requests from the frontend to the API.

CORS headers now properly returned:
  access-control-allow-origin: http://localhost:3000
  access-control-allow-credentials: true

Co-authored-by: Copilot <[email protected]>
2026-04-24 21:11:56 +08:00

8.1 KiB