refactor: rename Api project to Web
- HrynCo.NotificationService.Api -> HrynCo.NotificationService.Web - HrynCo.NotificationService.Api.IntegrationTests -> HrynCo.NotificationService.Web.IntegrationTests - Updated slnx, docker-compose, project references, and namespaces - Project serves both REST API and admin UI Ref: IT-628 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
using HrynCo.NotificationService.Web;
|
||||
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();
|
||||
Reference in New Issue
Block a user