CORS (Cross-Origin Resource Sharing) არის ბრაუზერის უსაფრთხოების მექანიზმი, რომელიც აკონტროლებს აქვს თუ არა ერთი origin-ის ვებ-გვერდს უფლება სერვერზე მოთხოვნის გაკეთებისთვის სხვა origin-ზე. ნაგულისხმევად, ბრაუზერი უბლოკავს cross-origin მოთხოვნებს; სერვერმა ცალსახად უნდა დაშვას ისინი response headers-ის მეშვეობით.
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.
