fix cors for development, add some forgottend migration
This commit is contained in:
parent
d7734cb68a
commit
251810c973
2 changed files with 323 additions and 0 deletions
|
|
@ -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>();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue