-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathProgram.cs
52 lines (49 loc) · 1.95 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
50
51
52
using ElectronNET.API;
using ReHUD.Factories;
using ReHUD.Interfaces;
using ReHUD.Services;
using ReHUD.Utils;
using System.Diagnostics;
namespace ReHUD;
public static class Program
{
public static void Main(string[] args) {
#if DEBUG
Debugger.Launch();
#endif
try {
CreateWebHostBuilder(args).Build().Run();
}
catch (Exception ex) {
Console.WriteLine("An error occurred: {0}", ex.Message);
Console.WriteLine(ex.StackTrace);
}
}
public static IHostBuilder CreateWebHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder => {
Console.WriteLine("Configuring Web Host Defaults");
webBuilder.UseElectron(args);
#if DEBUG
webBuilder.UseEnvironment(Environments.Development);
#endif
webBuilder.UseStartup<Startup>();
}).ConfigureLogging((hostingContext, logging) => {
logging.ClearProviders();
logging.AddConsole();
logging.AddDebug();
logging.AddEventSourceLogger();
logging.AddFilter("Microsoft", LogLevel.Warning)
.AddFilter("System", LogLevel.Warning)
.AddFilter("LoggingConsoleApp.Program", LogLevel.Debug);
}).ConfigureServices(services => {
services.AddLogging();
services.AddSignalR();
services.AddRazorPages();
services.AddSingleton<IProcessObserverFactory, ProcessObserverFactory>();
services.AddSingleton<IRaceRoomObserver, RaceRoomObserver>();
services.AddSingleton<ISharedMemoryService, SharedMemoryService>();
services.AddSingleton<IR3EDataService, R3EDataService>();
services.AddSingleton<IUpdateService, UpdateService>();
});
}