Mid ASP.NET Core

CORS for Web APIs?

Enable CORS (Cross-Origin Resource Sharing) to allow client apps from

different domains:

services.AddCors(options => {

options.AddPolicy("AllowFrontend", builder =>

builder.WithOrigins("

.AllowAnyHeader()

.AllowAnyMethod());

});

app.UseCors("AllowFrontend");

More from ASP.NET Core Tutorial

All questions for this course