Files
hrynco-notification-service/HrynCo.NotificationService.Api/Program.cs
T
Anatolii Grynchuk 2cc8b6b7f2 feat: add Scalar API reference UI
- Scalar.AspNetCore 2.14.9
- Available in Development at /scalar/v1
- Theme: DeepSpace

Ref: IT-628

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-02 01:39:50 +03:00

34 lines
941 B
C#

using HrynCo.NotificationService.Api;
using HrynCo.NotificationService.DAL.EF;
using HrynCo.NotificationService.Services;
using Scalar.AspNetCore;
var builder = WebApplication.CreateBuilder(args);
builder.AddSerilog();
var 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.AddControllers();
builder.Services.AddNotificationDataAccess(appSettings.ConnectionString);
builder.Services.AddNotificationServices();
var app = builder.Build();
if (app.Environment.IsDevelopment())
{
app.MapOpenApi();
app.MapScalarApiReference(options =>
{
options.Title = "HrynCo Notification Service";
options.Theme = ScalarTheme.DeepSpace;
});
}
app.UseHttpsRedirection();
app.MapControllers();
app.Run();