Path: redb/redb.Templates/templates/redb-app/RedbApp.Web/Program.cs Snapshot: redb, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb Page: https://redbase.app/src/dev-2026-12-06/redb/redb.Templates/templates/redb-app/RedbApp.Web/Program.cs ---- using Microsoft.AspNetCore.Components.Web; using Microsoft.AspNetCore.Components.WebAssembly.Hosting; using RedbApp.Web; using RedbApp.Web.Services; var builder = WebAssemblyHostBuilder.CreateDefault(args); builder.RootComponents.Add("#app"); builder.RootComponents.Add("head::after"); // Where the API is. wwwroot/appsettings.Development.json points at the API host on its own port; in a // deployment the setting is empty and the client calls its own origin, where nginx forwards /api/. var apiBase = builder.Configuration["ApiBaseUrl"] is { Length: > 0 } configured ? configured : builder.HostEnvironment.BaseAddress; builder.Services.AddSingleton(); builder.Services.AddScoped(_ => new HttpClient { BaseAddress = new Uri(apiBase) }); builder.Services.AddScoped(); await builder.Build().RunAsync();