CORS (Cross-Origin Resource Sharing) je mehanizem varnosti brskalnika, ki nadzoruje, ali lahko spletna stran iz enega origin pokliče vaš API na drugem origin. FastAPI ga konfigurira z vgrajenim CORSMiddleware. S CORS se srečate vsakič, ko frontend na drugem domenu/portu pokliče vaš API.
Problem, ki ga CORS rešuje
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)
