From 1c52840e2d6c1dab8f190a07b1ca1753a58b475a Mon Sep 17 00:00:00 2001 From: hz Date: Mon, 12 May 2025 13:34:03 -0700 Subject: [PATCH] Adding cors --- Program.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Program.cs b/Program.cs index 6029ca8..b109370 100644 --- a/Program.cs +++ b/Program.cs @@ -70,6 +70,16 @@ builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) }; }); +builder.Services.AddCors(options => +{ + options.AddDefaultPolicy(policy => + { + policy.AllowAnyOrigin() + .AllowAnyHeader() + .AllowAnyMethod(); + }); +}); + var app = builder.Build(); app.UseSwagger(); @@ -79,6 +89,7 @@ app.UseMiddleware(); app.UseAuthentication(); app.UseAuthorization(); +app.UseCors(); app.MapControllers(); app.Run(); \ No newline at end of file