using LiquidCode.Tester.Gateway.Services;

var builder = WebApplication.CreateBuilder(args);

// Add services to the container
builder.Services.AddControllers();
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddOpenApi();

// Add HttpClient
builder.Services.AddHttpClient();
builder.Services.AddMemoryCache();

// Register application services
builder.Services.AddSingleton<IPackageDownloadService, PackageDownloadService>();
builder.Services.AddSingleton<IWorkerClientService, WorkerClientService>();

var app = builder.Build();

// Configure the HTTP request pipeline
//if (app.Environment.IsDevelopment())
{
    app.UseSwagger();
    app.UseSwaggerUI();
    app.MapOpenApi();
}

app.MapControllers();

app.Run();
