-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
38 lines (28 loc) · 1.16 KB
/
Program.cs
File metadata and controls
38 lines (28 loc) · 1.16 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
using OpenHosting.Apps;
using OpenHosting.Services;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
CultureInfo.DefaultThreadCurrentCulture = CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo("en-US");
var builder = Host.CreateApplicationBuilder(args);
// Add logging
builder.Logging.AddConsole();
builder.Logging.AddDebug();
// Register services
builder.Services.AddSingleton<DockerService>();
builder.Services.AddSingleton<GitHubService>();
builder.Services.AddSingleton<ContainerService>();
var host = builder.Build();
var server = new Server();
#if DEBUG
server.UseHotReload();
#endif
// Register services with Ivy
server.Services.AddSingleton(host.Services.GetRequiredService<DockerService>());
server.Services.AddSingleton(host.Services.GetRequiredService<GitHubService>());
server.Services.AddSingleton(host.Services.GetRequiredService<ContainerService>());
server.AddAppsFromAssembly();
server.AddConnectionsFromAssembly();
var chromeSettings = new ChromeSettings().DefaultApp<SimpleContainerApp>().UseTabs(preventDuplicates: true);
server.UseChrome(chromeSettings);
await server.RunAsync();