CORS (Cross-Origin Resource Sharing) అనేది ఒక బ్రౌజర్ సెక్యూరిటీ మెకానిజం, ఇది ఒక origin నుండి వచ్చిన వెబ్ పేజీ మీ API ను వేరేలాంటి origin న నుండి కాల్ చేయగలిగిందో లేదో నియంత్రిస్తుంది. FastAPI దీనిని బిల్ట్-ఇన్ CORSMiddleware తో కాన్ఫిగర్ చేస్తుంది. వేరేలాంటి డొమైన్/పోర్ట్ నుండి ఫ్రంటెండ్ మీ 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)
