mirror of
https://github.com/DrMboga/WotBlitzStatisticsBlazor.git
synced 2026-10-24 20:00:05 +02:00
feat: Added blazor default scaffold
This commit is contained in:
1 parent
c9f933235c
commit
ba68481981
38 files changed
+1422
-3
No files matched your search
@@ -9,6 +9,7 @@ using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Diagnostics.HealthChecks;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using WotBlitzStatisticsPro.Common;
|
||||
using WotBlitzStatisticsPro.Common.Model;
|
||||
@@ -107,16 +108,35 @@ namespace WotBlitzStatisticsPro.GraphQl
|
||||
return ValueTask.CompletedTask;
|
||||
})
|
||||
;
|
||||
|
||||
// Blazor
|
||||
services.AddControllersWithViews();
|
||||
services.AddRazorPages();
|
||||
}
|
||||
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
{
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
app.UseWebAssemblyDebugging();
|
||||
}
|
||||
else
|
||||
{
|
||||
app.UseExceptionHandler("/Error");
|
||||
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
||||
app.UseHsts();
|
||||
}
|
||||
|
||||
app
|
||||
.UseBlazorFrameworkFiles()
|
||||
.UseStaticFiles()
|
||||
.UseRouting()
|
||||
.UseAuthorization()
|
||||
.UseAuthentication()
|
||||
.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapRazorPages();
|
||||
endpoints.MapGraphQL();
|
||||
endpoints.MapHealthChecks("/health/self", new HealthCheckOptions
|
||||
{
|
||||
@@ -126,7 +146,8 @@ namespace WotBlitzStatisticsPro.GraphQl
|
||||
{
|
||||
Predicate = r => r.Tags.Contains("services")
|
||||
});
|
||||
});
|
||||
endpoints.MapFallbackToFile("index.html");
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user