-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
42 lines (33 loc) · 1.11 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
using System.Reflection;
using Blazored.LocalStorage;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using ERmain;
using ERmain.Data.Language;
using ERmain.Data.Projects;
using ERmain.Data.Story;
using ERmain.Data.Theme;
ILogger<Program> logger;
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");
Configure(builder.Services);
ConfigureCMS(builder.Services);
var app = builder.Build();
await app.RunAsync();
void Configure(IServiceCollection services)
{
services.AddLogging(builder => builder.SetMinimumLevel(LogLevel.Debug));
logger = services.BuildServiceProvider().GetRequiredService<ILogger<Program>>();
services.AddBlazoredLocalStorage();
services.AddMemoryCache();
services.AddScoped<HttpClient>();
}
void ConfigureCMS(IServiceCollection services)
{
services.AddScoped<LanguageAPI>();
services.AddScoped<LanguageService>();
services.AddScoped<ThemeService>();
services.AddScoped<StoryAPI>();
services.AddScoped<ProjectsAPI>();
}