[backend/startup] Fix middleware ordering for WASM debugging

This commit is contained in:
Laura Hausmann 2024-04-17 01:20:36 +02:00
parent dca09cef56
commit 66554062f5
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -45,7 +45,9 @@ var app = builder.Build();
var config = await app.Initialize(args);
// This determines the order of middleware execution in the request pipeline
if (!app.Environment.IsDevelopment())
if (app.Environment.IsDevelopment())
app.UseWebAssemblyDebugging();
else
app.UseResponseCompression();
app.UseRouting();
@ -65,9 +67,6 @@ app.MapHub<StreamingHub>("/hubs/streaming");
app.MapRazorPages();
app.MapFallbackToPage("/Shared/FrontendSPA");
if (app.Environment.IsDevelopment())
app.UseWebAssemblyDebugging();
app.Urls.Clear();
if (config.ListenSocket == null)
app.Urls.Add($"http://{config.ListenHost}:{config.ListenPort}");