CORS (Cross-Origin Resource Sharing) என்பது ஒரு browser security mechanism ஆகும், இது ஒரு origin-இலிருந்து வரும் web page வேறு origin-இல் உள்ள உங்கள் API-ஐ அழைக்க முடியுமா என்பதைக் கட்டுப்படுத்துகிறது. FastAPI இதை built-in CORSMiddleware மூலம் configure செய்கிறது. வேறு domain/port-இல் உள்ள ஒரு frontend உங்கள் API-ஐ அழைக்கும்போதெல்லாம் நீங்கள் CORS-ஐ சந்திப்பீர்கள்.
CORS தீர்க்கும் பிரச்சினை
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)
