CORS (Cross-Origin Resource Sharing) ist ein Sicherheitsmechanismus des Browsers, der kontrolliert, ob eine Webseite von einer Quelle deine API auf einer anderen Quelle aufrufen kann. FastAPI konfiguriert es mit dem integrierten CORSMiddleware. Du wirst CORS begegnen, wenn immer ein Frontend auf einer anderen Domain/Port deine API aufruft.
Das Problem, das CORS löst
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)
