-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
49 lines (42 loc) · 1.47 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
37
38
39
40
41
42
43
44
45
46
47
48
49
using Delights.Modules.Hello;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Modulight.Modules;
using Modulight.Modules.Client.RazorComponents;
using Modulight.Modules.Hosting;
using Modulight.UI.Blazor.Services;
namespace Test.Modulights.UI
{
public class TestBlazorUIProvider : BlazorUIProvider
{
public TestBlazorUIProvider(IModuleHost host) : base(host)
{
}
}
}
namespace Test.Modulights.UI.Wasm
{
public class TestModule : RazorComponentClientModule
{
public TestModule(IModuleHost host) : base(host)
{
}
}
public class Program
{
public static async Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.ConfigureBlazorUI();
builder.RootComponents.Add<Modulight.UI.Blazor.App>("app");
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
builder.Services.AddModules(builder =>
{
builder.UseRazorComponentClientModules().AddBlazorUI<TestBlazorUIProvider>((o, sp) => o.RenderUIResources = true)
.AddModule<TestModule>();
//.AddHelloModule((o, _) => o.GraphQLEndpoint = "https://localhost:5001/graphql");
});
await builder.Build().RunAsyncWithModules();
}
}
}