CORS
A strict web security mechanism enforced by browsers that dictates whether a frontend application hosted on one domain is legally allowed to request data from an API hosted on a different domain.
What it is
By default, browsers block scripts from making requests to different domains to prevent malicious sites from silently stealing data. If a frontend (app.com) tries to hit a backend (api.com), the backend must explicitly send CORS headers verifying that app.com is a trusted origin. Misconfigured CORS is a notoriously common cause of application crashes during development.
When you would use it
You configure CORS policies on your backend servers to securely whitelist which external domains are permitted to interact with your API.
Common operations
- Configuring a backend Node.js server to accept API requests exclusively from an authorized React frontend.
- Troubleshooting browser console errors when fetching data from third-party APIs.