From 03313562d21d5db9bf6a14ebbeab80e06c883d3a Mon Sep 17 00:00:00 2001 From: Rory& Date: Wed, 24 Jan 2024 02:31:56 +0100 Subject: MRU->RMU, fixes, cleanup --- MatrixRoomUtils.Web/Program.cs | 57 ------------------------------------------ 1 file changed, 57 deletions(-) delete mode 100644 MatrixRoomUtils.Web/Program.cs (limited to 'MatrixRoomUtils.Web/Program.cs') diff --git a/MatrixRoomUtils.Web/Program.cs b/MatrixRoomUtils.Web/Program.cs deleted file mode 100644 index 277e4d1..0000000 --- a/MatrixRoomUtils.Web/Program.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System.Text.Json; -using System.Text.Json.Serialization; -using Blazored.LocalStorage; -using Blazored.SessionStorage; -using LibMatrix.Services; -using MatrixRoomUtils.Web; -using MatrixRoomUtils.Web.Classes; -using Microsoft.AspNetCore.Components.Web; -using Microsoft.AspNetCore.Components.WebAssembly.Hosting; - -var builder = WebAssemblyHostBuilder.CreateDefault(args); -builder.RootComponents.Add("#app"); -builder.RootComponents.Add("head::after"); - -// builder.Logging.SetMinimumLevel(LogLevel.Trace); - -builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); - -try { - builder.Configuration.AddJsonStream(await new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }.GetStreamAsync("/appsettings.json")); -#if DEBUG - builder.Configuration.AddJsonStream(await new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }.GetStreamAsync("/appsettings.Development.json")); -#endif -} -catch (Exception e) { - Console.WriteLine("Could not load appsettings: " + e); -} - -builder.Services.AddBlazoredLocalStorage(config => { - config.JsonSerializerOptions.DictionaryKeyPolicy = JsonNamingPolicy.CamelCase; - config.JsonSerializerOptions.DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull; - config.JsonSerializerOptions.IgnoreReadOnlyProperties = true; - config.JsonSerializerOptions.PropertyNameCaseInsensitive = true; - config.JsonSerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.CamelCase; - config.JsonSerializerOptions.ReadCommentHandling = JsonCommentHandling.Skip; - config.JsonSerializerOptions.WriteIndented = false; -}); -builder.Services.AddBlazoredSessionStorage(config => { - config.JsonSerializerOptions.DictionaryKeyPolicy = JsonNamingPolicy.CamelCase; - config.JsonSerializerOptions.DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull; - config.JsonSerializerOptions.IgnoreReadOnlyProperties = true; - config.JsonSerializerOptions.PropertyNameCaseInsensitive = true; - config.JsonSerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.CamelCase; - config.JsonSerializerOptions.ReadCommentHandling = JsonCommentHandling.Skip; - config.JsonSerializerOptions.WriteIndented = false; -}); - -builder.Services.AddScoped(x => - new TieredStorageService( - cacheStorageProvider: new SessionStorageProviderService(x.GetRequiredService()), - dataStorageProvider: new LocalStorageProviderService(x.GetRequiredService()) - ) -); - -builder.Services.AddRoryLibMatrixServices(); -builder.Services.AddScoped(); -await builder.Build().RunAsync(); -- cgit 1.5.1