Use the following code in the ConfigureService method of the StartUp file on your projects.
Then add the code app.UseCors("CORSPOLICY"); on the Configure method in the same file.
services.AddCors(options =>
{
options.AddPolicy("CORSPOLICY",
builder =>
{
builder
.AllowAnyMethod()
.AllowAnyHeader()
.AllowAnyOrigin();
});
});
0 Comentarios