using System.Reflection; using System.Text.Encodings.Web; using Elisa.WebAPI.Services; using Serilog; string ClientVersion = 30400.ToString(); string DataVersion = "d630eea53a1b869fa4d7d1479a3d09e7"; string ABVersion = 2024051417.ToString(); var builder = WebApplication.CreateBuilder(args); builder.Host.UseSerilog((context, configuration) => configuration.ReadFrom.Configuration(context.Configuration)); builder.Services.AddHttpClient(); // Add services to the container. builder.Services.AddControllers() .AddJsonOptions(options => { options.JsonSerializerOptions.Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping; }); // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); builder.Services.AddHostedService(provider => new ProxyBackgroundService("127.0.0.1")); var app = builder.Build(); // Configure the HTTP request pipeline. if (app.Environment.IsDevelopment()) { app.UseSwagger(); app.UseSwaggerUI(); } app.UseSerilogRequestLogging(); //app.UseHttpsRedirection(); app.UseAuthorization(); app.MapControllers(); Log.Information($"Version {Assembly.GetEntryAssembly()?.GetCustomAttribute()?.InformationalVersion}"); Log.Information($"Client Version: {ClientVersion}"); Log.Information($"Data Version: {DataVersion}"); Log.Information($"AB Version: {ABVersion}"); Log.Information($"Starting {Assembly.GetEntryAssembly()?.GetName().Name}..."); app.Run();