CORS is essentially the ability to request a resource from one domain from a page being served by a different domain: think, for example, of a page at http://mysite.com requesting a JavaScript file from http://javascriptdepository.com. This is done in all big portals—for example, for including visitor tracking or ad scripts. Modern browsers forbid this by default, but it is possible to enable it on a case-by-case basis.
If you want to learn more about CORS, please consult https://developer.mozilla.org/en/docs/Web/HTTP/Access_control_CORS.
ASP.NET Core supports CORS servicing. You first need to register the required services (in ConfigureServices), like this:
services.AddCors();
Or, a slightly more complex example involves defining a policy, like this:
services.AddCors(options =>
{
options.AddPolicy("CorsPolicy", builder =>
builder
.AllowAnyOrigin()
.AllowAnyMethod(...