The same-origin policy restricts requests made by browser scripts. A page and a requested resource have the same origin only when their protocol, host, and port, if specified, match. A script requesting a resource from another origin needs a mechanism such as CORS. section 3.1.1
A board-game app on another domain
A page at webapp.com loads an Angular app, which requests board games from mybglist-api.com/BoardGames. That API request crosses origins, unlike requests for the page’s own app.js and style.css files. section 3.1.1
To allow the browser app to use the API in ASP.NET Core:
- Register a CORS policy with AddCors; use WithOrigins to name an allowed origin, or AllowAnyOrigin for an unrestricted policy. section 3.1.1
- Enable the policy with app.UseCors(), or apply a named policy to selected endpoints with RequireCors. section 3.1.1

