Skip to content
This repository was archived by the owner on Dec 27, 2022. It is now read-only.

Commit cb0f00b

Browse files
committed
CORS
1 parent 5fda6e5 commit cb0f00b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

backend/Startup.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ public void ConfigureServices(IServiceCollection services)
5757
options => options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection"))
5858
);
5959

60+
services.AddCors(option =>
61+
{
62+
option.AddDefaultPolicy(builder =>
63+
{
64+
builder.AllowAnyOrigin().AllowAnyHeader().AllowAnyMethod();
65+
});
66+
});
6067

6168
}
6269

@@ -76,6 +83,8 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
7683

7784
app.UseRouting();
7885

86+
app.UseCors();
87+
7988
app.UseAuthorization();
8089

8190
app.UseEndpoints(endpoints =>

0 commit comments

Comments
 (0)