-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
39 lines (34 loc) · 1.04 KB
/
Program.cs
File metadata and controls
39 lines (34 loc) · 1.04 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
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using blasor_demo_container;
using Dapr.Client;
using Microsoft.Extensions.Logging;
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");
builder.Logging.SetMinimumLevel(LogLevel.Trace);
Console.WriteLine($"foo = {builder.Configuration["message"]}");
builder.Services.AddSingleton<DaprClient>(sp =>
{
try
{
return new DaprClientBuilder().Build();
}
catch (Exception ex)
{
Console.WriteLine("Error initializing DaprClient:");
Console.WriteLine(ex.Message);
throw;
}
});
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://localhost:3500/") });
try
{
var host = builder.Build();
await host.RunAsync();
}
catch (Exception ex)
{
Console.WriteLine("Error running the application:");
Console.WriteLine(ex.Message);
}