using PhilExampleCrawler.Common.Models; using WebAPI.Interfaces; using WebAPI.Services; var builder = WebApplication.CreateBuilder(args); //Configuring Services builder.Services.AddControllers(); builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); builder.Services.AddSingleton>, CrawlScheduler>>(); builder.Services.AddSingleton(); builder.Services.AddHostedService(provider => provider.GetService()); builder.Services.AddHttpClient(); var app = builder.Build(); //Configuring HTTP request pipeline if (app.Environment.IsDevelopment()) { app.UseSwagger(); app.UseSwaggerUI(); } else { app.UseHttpsRedirection(); } app.UseAuthorization(); app.MapControllers(); app.Run();