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