Skip to content

Commit

Permalink
Cors
Browse files Browse the repository at this point in the history
  • Loading branch information
aaberg committed Nov 26, 2021
1 parent f412579 commit 67c0698
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions swapi-dotnet/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public void ConfigureServices(IServiceCollection services)
options.ResponseBodyLogLimit = 4096;
});

services.AddCors();

services.AddSingleton<IAppConfiguration, AppConfiguration>();
}

Expand All @@ -53,6 +55,8 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "swapi_dotnet v1"));
}

app.UseCors(builder => builder.AllowAnyMethod().AllowAnyHeader().AllowAnyOrigin());

app.UseHttpLogging();

app.UseHttpsRedirection();
Expand Down

0 comments on commit 67c0698

Please sign in to comment.