Skip to content

Commit

Permalink
Update WebAppStartup.cs
Browse files Browse the repository at this point in the history
chore: Update WebAppStartup

Use top level replacement for app.UseEndpoints(...)
  • Loading branch information
axunonb committed Feb 22, 2024
1 parent b3a1311 commit fe6663c
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions TournamentCalendar/WebAppStartup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -318,13 +318,10 @@ public static void Configure(WebApplication app)
app.UseCors();
// UseAuthentication and UseAuthorization: after UseRouting and UseCors, but before UseEndpoints
app.UseAuthentication().UseAuthorization();
app.UseEndpoints(r =>
{
// We use attribute routing,
// so we don't implement endpoints.MapControllerRoute(...)
r.MapControllers();
r.MapRazorPages();
});
// The net6.0+ top level replacement for app.UseEndpoints(...)
// (WebApplication implements IEndpointRouteBuilder)
app.MapControllers();
app.MapRazorPages();

// Suppress exceptions when the connection is closed by the client
app.UseMiddleware<ClientAbortMiddleware>();
Expand Down

0 comments on commit fe6663c

Please sign in to comment.