intermediateCORS: Cross-Origin Resource Sharing
What is CORS, and what problem does it solve?
CORS (Cross-Origin Resource Sharing) is a browser-enforced mechanism that allows a server to explicitly declare which other origins (scheme+host+port combinations) are permitted to make requests to it and read the response. It relaxes the browser's default Same-Origin Policy in a controlled, server-approved way, enabling legitimate cross-origin use cases like a SPA on one port calling an API on another.
Ready to master this question?
Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.
Sign in to generate a response