2025-06-08 14:41:50 +01:00
|
|
|
|
// See https://aka.ms/new-console-template for more information
|
2025-07-16 00:47:50 +01:00
|
|
|
|
|
|
|
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
|
|
using Microsoft.Extensions.Hosting;
|
|
|
|
|
|
internal class Program
|
|
|
|
|
|
{
|
2026-06-11 00:14:51 +01:00
|
|
|
|
public static IHost AppHost { get; private set; }
|
2026-06-10 16:59:23 +01:00
|
|
|
|
public static IConfigurationRoot AppConfiguration { get; private set; }
|
|
|
|
|
|
public static IHostEnvironment AppEnvironment { get; private set; }
|
2025-07-16 00:47:50 +01:00
|
|
|
|
|
|
|
|
|
|
private static void Main(string[] args)
|
|
|
|
|
|
{
|
|
|
|
|
|
HostApplicationBuilder builder = Host.CreateApplicationBuilder(args);
|
2026-06-13 20:57:30 +01:00
|
|
|
|
builder.Configuration
|
|
|
|
|
|
.AddJsonFile("appsettings-cli.json", optional: false, reloadOnChange: false)
|
2026-06-15 00:11:48 +01:00
|
|
|
|
.AddJsonFile($"appsettings-cli.{builder.Environment.EnvironmentName}.json", optional: true, reloadOnChange: false)
|
2026-06-13 20:57:30 +01:00
|
|
|
|
.AddEnvironmentVariables();
|
2026-08-22 03:34:48 +01:00
|
|
|
|
|
2025-07-16 00:47:50 +01:00
|
|
|
|
AppHost = builder.Build();
|
|
|
|
|
|
AppConfiguration = builder.Configuration;
|
|
|
|
|
|
AppHost.Start();
|
|
|
|
|
|
AppEnvironment = builder.Environment;
|
|
|
|
|
|
Console.WriteLine("Hello, World!");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|