fix cors for development, add some forgottend migration

This commit is contained in:
Вячеслав 2025-05-08 23:58:13 +05:00
parent d7734cb68a
commit 251810c973
2 changed files with 323 additions and 0 deletions

View file

@ -92,6 +92,19 @@ public class Program
c.IncludeXmlComments(filePath);
});
builder.Services.AddCors(options =>
{
options.AddPolicy("AllowAll",
policyBuilder =>
{
policyBuilder
.AllowAnyOrigin()
.AllowAnyHeader()
.AllowAnyMethod()
.SetIsOriginAllowedToAllowWildcardSubdomains();
});
});
var app = builder.Build();
if (app.Environment.IsDevelopment())
@ -102,6 +115,8 @@ public class Program
options.SwaggerEndpoint("/api/swagger/v1/swagger.json", "Survey Backend V1");
options.RoutePrefix = "api/swagger";
});
app.UseCors("AllowAll");
}
app.UseMiddleware<ExceptionsMiddleware>();