add missing fields
This commit is contained in:
15
Startup.cs
15
Startup.cs
@@ -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 =>
|
||||
|
||||
Reference in New Issue
Block a user