diff --git a/Wave/Program.cs b/Wave/Program.cs index b753aec..c5ed446 100644 --- a/Wave/Program.cs +++ b/Wave/Program.cs @@ -5,12 +5,13 @@ using Wave.Components; using Wave.Components.Account; using Wave.Data; +using Wave.Services; var builder = WebApplication.CreateBuilder(args); builder.Configuration.AddEnvironmentVariables("WAVE_"); -// Add services to the container. -builder.Services.AddRazorComponents(); +builder.Services.AddRazorComponents().AddInteractiveServerComponents(); +builder.Services.AddControllers(); #region Authentication & Authorization @@ -51,6 +52,7 @@ builder.Services.AddLocalization(options => { options.ResourcesPath = "Resources"; }); +builder.Services.AddScoped(); #endregion @@ -66,11 +68,13 @@ app.UseStaticFiles(); app.UseAntiforgery(); -app.MapRazorComponents(); +app.MapRazorComponents().AddInteractiveServerRenderMode(); // Add additional endpoints required by the Identity /Account Razor components. app.MapAdditionalIdentityEndpoints(); +app.MapControllers(); + string[] cultures = ["en-US", "en-GB", "de-DE"]; app.UseRequestLocalization(new RequestLocalizationOptions { ApplyCurrentCultureToResponseHeaders = true,