-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
36 lines (28 loc) · 1.37 KB
/
Program.cs
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
using Blazored.SessionStorage;
using Frontend;
using Frontend.Channel_Utility;
using Frontend.Client_Utility;
using Frontend.Token_Utility;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using RedBoxAuthentication;
using RedBoxServices;
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)
});
var channel = new ChannelUtility();
builder.Services.AddSingleton(channel);
builder.Services.AddSingleton(new AuthenticationGrpcService.AuthenticationGrpcServiceClient(channel.GetChannel()));
builder.Services.AddSingleton(new GrpcConversationServices.GrpcConversationServicesClient(channel.GetChannel()));
builder.Services.AddSingleton(
new GrpcSupervisedConversationService.GrpcSupervisedConversationServiceClient(channel.GetChannel()));
builder.Services.AddSingleton(new GrpcAccountServices.GrpcAccountServicesClient(channel.GetChannel()));
builder.Services.AddSingleton(new GrpcAdminServices.GrpcAdminServicesClient(channel.GetChannel()));
builder.Services.AddSingleton<TokenUtility>();
builder.Services.AddSingleton<ClientUtility>();
builder.Services.AddBlazoredSessionStorageAsSingleton();
await builder.Build().RunAsync();