refactor: simplify Program.cs and clean up NuGet.Config
#9
@@ -3,11 +3,11 @@ using HrynCo.NotificationService.DAL.EF;
|
|||||||
using HrynCo.NotificationService.Services;
|
using HrynCo.NotificationService.Services;
|
||||||
using Scalar.AspNetCore;
|
using Scalar.AspNetCore;
|
||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
builder.AddSerilog();
|
builder.AddSerilog();
|
||||||
|
|
||||||
var appSettings = builder.Configuration
|
AppSettings appSettings = builder.Configuration
|
||||||
.GetSection(AppSettings.SectionName)
|
.GetSection(AppSettings.SectionName)
|
||||||
.Get<AppSettings>() ?? throw new InvalidOperationException("App settings are not configured.");
|
.Get<AppSettings>() ?? throw new InvalidOperationException("App settings are not configured.");
|
||||||
|
|
||||||
@@ -18,17 +18,14 @@ builder.Services.AddControllersWithViews()
|
|||||||
builder.Services.AddNotificationDataAccess(appSettings.ConnectionString);
|
builder.Services.AddNotificationDataAccess(appSettings.ConnectionString);
|
||||||
builder.Services.AddNotificationServices();
|
builder.Services.AddNotificationServices();
|
||||||
|
|
||||||
var app = builder.Build();
|
WebApplication app = builder.Build();
|
||||||
|
|
||||||
if (app.Environment.IsDevelopment())
|
|
||||||
{
|
|
||||||
app.MapOpenApi();
|
app.MapOpenApi();
|
||||||
app.MapScalarApiReference(options =>
|
app.MapScalarApiReference(options =>
|
||||||
{
|
{
|
||||||
options.Title = "HrynCo Notification Service";
|
options.Title = "HrynCo Notification Service";
|
||||||
options.Theme = ScalarTheme.DeepSpace;
|
options.Theme = ScalarTheme.DeepSpace;
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
app.UseStaticFiles();
|
app.UseStaticFiles();
|
||||||
app.UseHttpsRedirection();
|
app.UseHttpsRedirection();
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<config>
|
|
||||||
<add key="globalPackagesFolder" value="%USERPROFILE%\.nuget\packages" />
|
|
||||||
</config>
|
|
||||||
<packageSources>
|
<packageSources>
|
||||||
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
|
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
|
||||||
</packageSources>
|
</packageSources>
|
||||||
|
|||||||
Reference in New Issue
Block a user