CORS (Cross-Origin Resource Sharing) é um mecanismo de segurança do navegador que controla se uma página web de uma origem pode chamar sua API em uma origem diferente. FastAPI a configura com o CORSMiddleware integrado. Você enfrentará CORS sempre que um frontend em um domínio/porta diferente chamar sua API.
O problema que CORS resolve
A React app at http://localhost:3000 calling an API at http://localhost:8000 is
CROSS-ORIGIN (different port). The BROWSER blocks the response unless the API
sends CORS headers permitting that origin.
(origin = scheme + host + port)
