CORS (Cross-Origin Resource Sharing) est un mécanisme de sécurité du navigateur qui contrôle si une page web d'une origine peut appeler votre API sur une origine différente. FastAPI le configure avec le CORSMiddleware intégré. Vous rencontrerez CORS chaque fois qu'un frontend sur un domaine/port différent appelle votre API.
Le problème que CORS résout
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)
