Configuring CORS globally vs per endpoint?
- Global CORS: Apply a policy for all endpoints by adding middleware early in the
pipeline with app.UseCors(...).
- Per-endpoint CORS: Apply CORS policies selectively using the
[EnableCors("PolicyName")] or [DisableCors] attributes on controllers or
actions.