59 lines
1.8 KiB
C#
59 lines
1.8 KiB
C#
using NexusReader.Web.Components;
|
||
using NexusReader.Application;
|
||
using NexusReader.Infrastructure;
|
||
using NexusReader.Application.Abstractions.Services;
|
||
using NexusReader.Web.Client.Services;
|
||
using NexusReader.UI.Shared.Services;
|
||
|
||
var builder = WebApplication.CreateBuilder(args);
|
||
|
||
// Add services to the container.
|
||
builder.Services.AddRazorComponents()
|
||
.AddInteractiveServerComponents()
|
||
.AddInteractiveWebAssemblyComponents();
|
||
|
||
// Enable detailed circuit errors for Server‑Side Blazor components
|
||
builder.Services.AddServerSideBlazor()
|
||
.AddCircuitOptions(options =>
|
||
{
|
||
options.DetailedErrors = true;
|
||
});
|
||
|
||
builder.Services.AddScoped<IPlatformService, WebPlatformService>();
|
||
builder.Services.AddScoped<IThemeService, ThemeService>();
|
||
builder.Services.AddScoped<IQuizStateService, QuizStateService>();
|
||
builder.Services.AddScoped<IFocusModeService, FocusModeService>();
|
||
|
||
builder.Services.AddApplication();
|
||
builder.Services.AddInfrastructure();
|
||
|
||
var app = builder.Build();
|
||
|
||
// Configure the HTTP request pipeline.
|
||
if (app.Environment.IsDevelopment())
|
||
{
|
||
app.UseWebAssemblyDebugging();
|
||
}
|
||
else
|
||
{
|
||
app.UseExceptionHandler("/Error", createScopeForErrors: true);
|
||
// 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.UseStatusCodePagesWithReExecute("/not-found", createScopeForStatusCodePages: true);
|
||
if (!app.Environment.IsDevelopment())
|
||
{
|
||
app.UseHttpsRedirection();
|
||
}
|
||
|
||
app.UseAntiforgery();
|
||
|
||
app.MapStaticAssets();
|
||
app.MapRazorComponents<App>()
|
||
.AddInteractiveServerRenderMode()
|
||
.AddInteractiveWebAssemblyRenderMode()
|
||
.AddAdditionalAssemblies(typeof(NexusReader.UI.Shared._Imports).Assembly);
|
||
|
||
|
||
app.Run();
|