diff options
author | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-05-01 02:43:32 +0200 |
---|---|---|
committer | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-05-01 02:43:32 +0200 |
commit | df9031c47f8e97d8e2df3177093271a458f27267 (patch) | |
tree | 4e81dec4048c6e76a928ef69c905560d7c173fdf /MatrixRoomUtils.Web/Program.cs | |
download | MatrixUtils-df9031c47f8e97d8e2df3177093271a458f27267.tar.xz |
Initial commit
Diffstat (limited to 'MatrixRoomUtils.Web/Program.cs')
-rw-r--r-- | MatrixRoomUtils.Web/Program.cs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/MatrixRoomUtils.Web/Program.cs b/MatrixRoomUtils.Web/Program.cs new file mode 100644 index 0000000..410a98f --- /dev/null +++ b/MatrixRoomUtils.Web/Program.cs @@ -0,0 +1,25 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using Blazored.LocalStorage;using MatrixRoomUtils; +using MatrixRoomUtils.StateEventTypes; +using Microsoft.AspNetCore.Components.Web; +using Microsoft.AspNetCore.Components.WebAssembly.Hosting; +using MatrixRoomUtils.Web; + +var builder = WebAssemblyHostBuilder.CreateDefault(args); +builder.RootComponents.Add<App>("#app"); +builder.RootComponents.Add<HeadOutlet>("head::after"); + +builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); +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; +}); + +await builder.Build().RunAsync(); \ No newline at end of file |