Skip to content

Commit

Permalink
Fixed launch settings for environments.
Browse files Browse the repository at this point in the history
  • Loading branch information
PolygeneLubricants committed Dec 29, 2023
1 parent 54c2686 commit 601442f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/PlanningPoker.Server/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ public static IWebHost BuildWebHost(string[] args)
.AddCommandLine(args)
.Build())
.UseStartup<Startup>()

// Leaving commented code in the codebase is not a good idea,
// but I think this warrants an exception.
// Blazor does not allow local debugging where you set the ASPNETCORE_ENVIRONMENT to anything
// other than Development: https://github.com/dotnet/aspnetcore/issues/43110#issuecomment-1206573745.
// In order to test environment-specific configuration,
// the below line has to be added.
// Note, this line should *not* be added in production code,
// as it enables locally run code to get static assets from the build output.
// We don't want that behavior on an environment running on published files.
//.UseStaticWebAssets() // <-- This is the line to comment in to test environments.
// End comment block.
.Build();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/PlanningPoker.Server/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
app.UseWebAssemblyDebugging();
}

app.UseStaticFiles();
app.UseBlazorFrameworkFiles();
app.UseStaticFiles();

app.UseRouting();

Expand Down

0 comments on commit 601442f

Please sign in to comment.