Allow CORS for any origin whilst in development

This commit is contained in:
Stedoss 2022-11-01 20:20:49 +00:00
parent 0fd2523629
commit 70aa790c16

View File

@ -14,6 +14,8 @@ builder.Services.AddSwaggerGen();
// App services // App services
builder.Services.AddServiceDependencies(); builder.Services.AddServiceDependencies();
builder.Services.AddCors();
var app = builder.Build(); var app = builder.Build();
@ -28,6 +30,9 @@ if (app.Environment.IsDevelopment())
{ {
app.UseSwagger(); app.UseSwagger();
app.UseSwaggerUI(); app.UseSwaggerUI();
app.UseCors(options =>
options.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader());
} }
app.UseHttpsRedirection(); app.UseHttpsRedirection();