Added option to disable the client hosting of the api server

This commit is contained in:
Masu Baumgartner
2024-11-03 19:20:51 +01:00
parent b73c3ebfb3
commit 17a4e7ec14
5 changed files with 31 additions and 7 deletions

View File

@@ -131,11 +131,14 @@ var app = builder.Build();
await Startup.PrepareDatabase(app);
if (app.Environment.IsDevelopment())
app.UseWebAssemblyDebugging();
if (config.Client.Enable)
{
if (app.Environment.IsDevelopment())
app.UseWebAssemblyDebugging();
app.UseBlazorFrameworkFiles();
app.UseStaticFiles();
app.UseBlazorFrameworkFiles();
app.UseStaticFiles();
}
app.UseRouting();
@@ -184,6 +187,8 @@ foreach (var endpointStartup in endpointStartupInterfaces)
}
app.MapControllers();
app.MapFallbackToFile("index.html");
if(config.Client.Enable)
app.MapFallbackToFile("index.html");
app.Run();