CORS (Cross-Origin Resource Sharing) हा एक ब्राउজर सुरक्षा यंत्रणा आहे जो नियंत्रित करते की एका origin वरील वेब पृष्ठ भिन्न origin वरील तुमचे API ला कॉल करू शकतो की नाही. 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)
