Fixed dependencies and config
continuous-integration/drone/pr Build is passing

This commit is contained in:
Khwezi Mngoma
2026-05-23 12:05:47 +02:00
parent 4747b27f83
commit 446292784c
4 changed files with 84 additions and 7 deletions
+37 -4
View File
@@ -1,20 +1,53 @@
using LiteCharms.Features.Extensions;
using LiteCharms.Features.Mediator;
using MidrandBookshop.Components;
using static LiteCharms.Features.Extensions.Quartz;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();
builder.AddMonitoring();
builder.Services.AddEndpointsApiExplorer();
//builder.Services.AddMediator();
//builder.Services.AddScoped(typeof(IPipelineBehavior<,>), typeof(TelemetryPipelineBehavior<,>));
//builder.Services.AddScoped(typeof(IPipelineBehavior<,>), typeof(LoggingPipelineBehavior<,>));
//builder.Services.AddSalesServiceBus();
//builder.Services.AddGeneralServiceBus();
builder.Services.AddQuartzSchedulerClient(MidrandShopSchedulerName, builder.Configuration);
//builder.Services.AddEmailServices(builder.Configuration);
//builder.Services.AddEmailServiceBus();
builder.Services.AddMidrandShopDatabase(builder.Configuration);
builder.Services.AddMidrandShopPostgresHealthCheck();
//builder.Services.AddMidrandShopQuartzHealthCheck();
builder.Services.AddHealthChecksSupport(builder.Configuration);
var app = builder.Build();
// Configure the HTTP request pipeline.
var schedulerFactory = app.Services.GetRequiredService<ISchedulerFactory>();
var scheduler = await schedulerFactory.GetScheduler(MidrandShopSchedulerName);
if (!scheduler!.IsStarted)
await scheduler.Start();
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error", createScopeForErrors: true);
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseHealthChecks("/health", new HealthCheckOptions
{
ResponseWriter = HealthChecks.UI.Client.UIResponseWriter.WriteHealthCheckUIResponse
});
app.UseStatusCodePagesWithReExecute("/not-found", createScopeForStatusCodePages: true);
app.UseHttpsRedirection();
@@ -24,4 +57,4 @@ app.MapStaticAssets();
app.MapRazorComponents<App>()
.AddInteractiveServerRenderMode();
app.Run();
app.Run();