feat: add a CORS configuration
This commit is contained in:
parent
788103c8a5
commit
d5b3859e86
@ -30,9 +30,17 @@ public class Program
|
||||
builder.Configuration.AddJsonFile(Settings.FilePath, optional: true, reloadOnChange: true);
|
||||
|
||||
// Add services to the container.
|
||||
|
||||
builder.Services.AddControllers();
|
||||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
||||
|
||||
builder.Services.AddCors(options =>
|
||||
{
|
||||
options.AddPolicy("AllowAll", policy =>
|
||||
{
|
||||
policy.AllowAnyHeader();
|
||||
policy.AllowAnyMethod();
|
||||
policy.AllowAnyOrigin();
|
||||
});
|
||||
});
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddSwaggerGen();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user