1631786ce2
Add push contracts, provider delivery and channel diagnostics. Link email channels to services and document migration and validation. Ref: IT-1074
40 lines
1.4 KiB
C#
40 lines
1.4 KiB
C#
using HrynCo.NotificationService.Web;
|
|
using HrynCo.NotificationService.DAL.EF;
|
|
using HrynCo.NotificationService.Services;
|
|
using Scalar.AspNetCore;
|
|
|
|
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
|
|
|
|
builder.AddSerilog();
|
|
|
|
AppSettings appSettings = builder.Configuration
|
|
.GetSection(AppSettings.SectionName)
|
|
.Get<AppSettings>() ?? throw new InvalidOperationException("App settings are not configured.");
|
|
|
|
builder.Services.AddSingleton(appSettings);
|
|
builder.Services.AddOpenApi();
|
|
builder.Services.AddControllersWithViews()
|
|
.AddRazorRuntimeCompilation();
|
|
builder.Services.AddNotificationDataAccess(appSettings.ConnectionString);
|
|
builder.Services.AddNotificationServices();
|
|
builder.Services.AddTransient<HrynCo.NotificationService.Worker.Services.Push.IFirebasePushClient,
|
|
HrynCo.NotificationService.Worker.Services.Push.FirebasePushClient>();
|
|
builder.Services.AddTransient<HrynCo.NotificationService.Worker.Services.Push.PushChannelTestService>();
|
|
|
|
WebApplication app = builder.Build();
|
|
|
|
app.MapOpenApi();
|
|
app.MapScalarApiReference(options =>
|
|
{
|
|
options.Title = "HrynCo Notification Service";
|
|
options.Theme = ScalarTheme.DeepSpace;
|
|
});
|
|
|
|
app.UseStaticFiles();
|
|
app.UseHttpsRedirection();
|
|
app.MapGet("/", () => Results.Redirect("/admin/services"));
|
|
app.MapControllers();
|
|
app.MapDefaultControllerRoute();
|
|
app.Run();
|
|
public partial class Program { }
|