CORS (Cross-Origin Resource Sharing) అనేది ఒక origin నుండి వచ్చిన వెబ్ పేజీ వేరే origin లో సర్వర్ కు అభ్యర్థనలు చేయగలదా అని నియంత్రించే బ్రౌజర్ సురక్షా విధానం. డిఫాల్ట్గా, బ్రౌజర్లు cross-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.
