CORS (Cross-Origin Resource Sharing) एक ब्राउजर सुरक्षा मेकानिजम हो जसले नियन्त्रण गर्छ कि एक origin बाट आएको वेब पृष्ठ अन्य origin मा रहेको सर्भरमा अनुरोध गर्न सक्छ कि सक्दैन। पूर्वनिर्धारित रूपमा, ब्राउजरहरूले क्रस-ओरिजिन अनुरोधहरू रोक्छन्; सर्भरले प्रतिक्रिया हेडर्स मार्फत स्पष्ट रूपमा तिनलाई अनुमति दिनु पर्छ।
Same-origin नीति र समस्या
Origin = scheme + host + port. These are DIFFERENT origins:
https://app.example.com → https://api.example.com (different host)
http://localhost:3000 → http://localhost:4000 (different port)
Browser blocks the cross-origin request UNLESS the server sends CORS headers allowing it.
