using IWS5.Server;
using IWS5.Server.Configuration;
using IWS5.Server.Extensions;
using Serilog;

var builder = Host.CreateApplicationBuilder(args);

var license_key = "NDEzOTIyOEAzMzMwMmUzMDJlMzAzYjMzMzQzYm1oVXFnQkVzRUt0QWVydUlJRXJqTDRlOXRiazZuYmJEZmJReEU3L2N1Nms9";
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense(license_key);

Log.Logger = new LoggerConfiguration()
    .ReadFrom.Configuration(builder.Configuration)
    .CreateLogger();

builder.Services.AddSingleton<Serilog.ILogger>(Log.Logger);

builder.Services.AddSerilog();

// Configure ProcessAgent options
builder.Services.Configure<ProcessAgent>(builder.Configuration.GetSection("ProcessAgent"));

builder.Services.AddHostedService<Worker>();
builder.Services.RegisterDependencies(builder.Configuration);

var host = builder.Build();
host.Run();
