Skip to content

Commit

Permalink
Added cors back
Browse files Browse the repository at this point in the history
  • Loading branch information
domshyra committed Apr 2, 2023
1 parent c8ebdec commit 15c19aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Api/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
builder.Services.AddSwaggerGen();
builder.Services.AddControllersWithViews();
//TODO remove
// builder.Services.AddCors();
builder.Services.AddCors();
builder.Services.AddDbContext<PlaylistDbContext>(options =>
options.UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking));

Expand All @@ -39,7 +39,7 @@


//TODO remove
// app.UseCors(p => p.WithOrigins("http://localhost:3000").AllowAnyHeader().AllowAnyMethod());
app.UseCors(p => p.WithOrigins(app.Configuration["FrontEndUrl"]).AllowAnyHeader().AllowAnyMethod());
app.UseRouting();
app.UseEndpoints(e => e.MapDefaultControllerRoute());
app.MapFallbackToFile("index.html");
Expand Down
2 changes: 1 addition & 1 deletion Api/appsettings.Development.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"Microsoft.AspNetCore": "Warning"
}
},
"Url": "http://localhost:3000"
"FrontEndUrl": "http://localhost:3000"
}

0 comments on commit 15c19aa

Please sign in to comment.