Program.cs
var corsPolicyName = "_myAllowSpecificOrigins";
builder.Services.AddCors(options =>
{
options.AddPolicy(name: corsPolicyName,
builder =>
{
builder.WithOrigins("http://localhost:8080", "*")
.AllowAnyHeader()
.AllowAnyMethod();
});
});
app.UseCors(corsPolicyName);