Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Application/ApplicationServiceExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ public static IServiceCollection AddApplication(this IServiceCollection services
// Settings
services.AddScoped<GetSettingsHandler>();
services.AddScoped<SaveSettingsHandler>();
services.AddScoped<TestArrConnectionHandler>();
// NB: TestArrConnectionHandler is registered by the Web host only — it needs IArrClient, which
// only a host that calls AddArrClient() provides. Registering it here made every host fail to
// start under DI validate-on-build (i.e. in Development).

// Auth (#48) — SetupToken is a singleton so it survives for the process lifetime and is
// logged once at startup; the handlers are scoped like every other use-case.
Expand Down
14 changes: 14 additions & 0 deletions src/Presentation/Web/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Threading.RateLimiting;
using Krautwatch.Application;
using Krautwatch.Application.Auth;
using Krautwatch.Application.Settings;
using Krautwatch.Infrastructure;
using Krautwatch.Web;
using Krautwatch.Web.Components;
Expand All @@ -13,6 +14,14 @@
var builder = WebApplication.CreateBuilder(args);

builder.AddServiceDefaults();

// Load the static-web-assets manifest explicitly. The framework only does this in Development, and none of
// our hosts run as Development (there are no launch profiles, and Aspire does not set one), so
// _framework/blazor.web.js returned a 500 and compressed assets returned an empty 200 — the UI loaded
// unstyled and completely inert, with no error anywhere obvious. No-op when the manifest is absent, i.e. in
// a published app where the assets are copied into wwwroot. See #63.
builder.WebHost.UseStaticWebAssets();

builder.Services.AddRazorComponents().AddInteractiveServerComponents();

var connectionString = builder.Configuration.GetConnectionString("krautwatch")
Expand All @@ -25,6 +34,11 @@
});
builder.Services.AddApplication();

// Outbound Sonarr/Radarr client + the Action that uses it. Paired deliberately: the handler cannot be
// constructed without the client, so whichever host wants one must wire both (#4).
builder.Services.AddArrClient();
builder.Services.AddScoped<TestArrConnectionHandler>();

// ──────────────────────────────────────────────────────────────
// Authentication (#48)
//
Expand Down