CORS (Cross-Origin Resource Sharing) is a browser security mechanism controlling whether a web page from one origin can call your API on a different origin. FastAPI configures it with the built-in CORSMiddleware. You'll hit CORS whenever a frontend on a different domain/port calls your API.
The problem CORS addresses
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)
