using ContainerDashboard.Services; using ContainerDashboard.Repositories; var builder = WebApplication.CreateBuilder(args); // Add services to the container. // Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi builder.Services.AddOpenApi(); builder.Services.AddTransient(); builder.Services.AddControllers(); var backend = Environment.GetEnvironmentVariable("BACKEND"); switch (backend) { case "kubernetes": builder.Services.AddTransient(); break; case "docker": throw new NotImplementedException(); default: throw new Exception("Incorrect backend variable"); } var app = builder.Build(); // Configure the HTTP request pipeline. if (app.Environment.IsDevelopment()) { app.MapOpenApi(); } app.UseHttpsRedirection(); app.MapControllers(); app.Run();