Skip to content

Commit

Permalink
#25 turned on very permissive CORS
Browse files Browse the repository at this point in the history
  • Loading branch information
mgroves committed Sep 26, 2023
1 parent ed13438 commit 772e36d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Conduit/Conduit.Web/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ public static void Main(string[] args)

builder.Services.AddConduitServiceDependencies(builder.Configuration);

builder.Services.AddCors(options =>
{
options.AddPolicy(name: "CorsPolicy",
builder =>
{
builder.AllowAnyOrigin()
.AllowAnyHeader()
.AllowAnyMethod();
});
});

// ****************************************************

var app = builder.Build();
Expand All @@ -54,6 +65,8 @@ public static void Main(string[] args)

app.MapControllers();

app.UseCors("CorsPolicy");

app.Run();

// Add the following line to close the Couchbase connection inside the app.Run() method at the end of Program.cs
Expand Down

0 comments on commit 772e36d

Please sign in to comment.