CORS (Cross-Origin Resource Sharing) huwa mekkaniżmu ta' sigurtà tal-browser li jikkontrolla jekk paġna web minn oriġini waħda tista' ċċaj l-API tiegħek fuq oriġini differenti. FastAPI jikkunfiguraha bl-CORSMiddleware integrata. Inti se taqbel CORS kull meta frontend minn domain/port differenti jċaj l-API tiegħek.
Il-problema li CORS ssolvi
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)
