using MaksIT.LetsEncryptServer; using MaksIT.LetsEncrypt.Services; using MaksIT.LetsEncryptServer.Services; using MaksIT.LetsEncryptServer.BackgroundServices; var builder = WebApplication.CreateBuilder(args); // Extract configuration var configuration = builder.Configuration; // Configure strongly typed settings objects var configurationSection = configuration.GetSection("Configuration"); var appSettings = configurationSection.Get() ?? throw new ArgumentNullException(); // Allow configurations to be available through IOptions builder.Services.Configure(configurationSection); // Add services to the container. builder.Services.AddControllers(); // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); builder.Services.AddMemoryCache(); builder.Services.AddHttpClient(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddHttpClient(); builder.Services.AddHostedService(); var app = builder.Build(); // Configure the HTTP request pipeline. if (app.Environment.IsDevelopment()) { app.UseSwagger(); app.UseSwaggerUI(); } app.UseAuthorization(); app.MapControllers(); app.Run();