add missing fields

This commit is contained in:
Julian
2022-02-12 20:08:48 +01:00
parent 3154152851
commit 2a3af9b0a0
7 changed files with 50 additions and 2 deletions

View File

@@ -23,6 +23,8 @@ namespace weddingapi
{
public class Startup
{
private string MyAllowSpecificOrigins = "defaultCors";
public Startup(IConfiguration configuration)
{
Configuration = configuration;
@@ -57,6 +59,17 @@ namespace weddingapi
timeout: TimeSpan.FromSeconds(3),
tags: new[] { "ready" });
services.AddCors(options =>
{
options.AddPolicy(name: MyAllowSpecificOrigins,
builder =>
{
builder.AllowAnyOrigin()
.AllowAnyHeader()
.AllowAnyMethod();
});
});
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
@@ -76,6 +89,8 @@ namespace weddingapi
app.UseRouting();
app.UseCors(MyAllowSpecificOrigins);
app.UseAuthorization();
app.UseEndpoints(endpoints =>