-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathProgram.cs
More file actions
40 lines (30 loc) · 1.14 KB
/
Copy pathProgram.cs
File metadata and controls
40 lines (30 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using Blazored.LocalStorage;
using ghp_app;
using ghp_app.Services;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.Hosting;
using MudBlazor.Services;
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");
builder.Services.AddMudServices().AddMudBlazorDialog();
builder.Services.AddBlazoredLocalStorage();
builder.Services.AddSingleton<AppUpdateService>();
builder.Services.AddScoped<AppVersionService>();
builder.Services.AddSingleton<GlobalErrorService>();
builder.Services.AddSingleton<LoadingService>();
builder.Services.AddSingleton<PageSettingsProvider>();
builder.Services.AddScoped<SettingsService>();
builder.Services.AddScoped<DiscordUserService>();
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
var host = builder.Build();
var discordService = host.Services.GetRequiredService<DiscordUserService>();
try
{
await discordService.GetUserInfoAsync();
}
catch (Exception ex)
{
}
await host.RunAsync();