-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
33 lines (27 loc) · 1.1 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
using System.Collections;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using CourseView;
using MudBlazor.Services;
using Newtonsoft.Json;
namespace CourseView
{
class Program
{
static async Task Main(string[] args)
{
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.AddMudServices();
//Console.WriteLine($"Payload: {JsonConvert.DeserializeObject<Hashtable>(new HttpClient().GetAsync("http://localhost:5157/course").Result.Content.ReadAsStringAsync().Result)["Payload"]}");
CourseManager.LoadConfig();
CourseManager.Initialize();
await builder.Build().RunAsync();
}
}
}