checkpoint

This commit is contained in:
2026-10-28 11:10:46 +02:00
parent c5c9d74937
commit cce5e348b3
10 changed files with 333 additions and 46 deletions
+4
View File
@@ -23,6 +23,8 @@ public class Program
builder.Services.AddLocalization(o => o.ResourcesPath = "LanguagesValues");
builder.Services.AddRazorPages();
builder.Services.AddControllers();
builder.Services.AddScoped<StatiKosev.Services.MessageService>();
builder.Services.AddNpgsqlDataSource(databaseConnectionString);
builder.Services.AddDbContext<AppDbContext>((sp, o) =>
o.UseNpgsql(sp.GetRequiredService<NpgsqlDataSource>())); // EF shares the same connection pool
@@ -80,6 +82,7 @@ public class Program
var app = builder.Build();
app.UseAntiforgery();
app.UseRateLimiter();
//accounts
//safety check if form sends us to the same domain
@@ -126,6 +129,7 @@ public class Program
app.UseStaticFiles(); // CSS/JS/images from wwwroot
app.MapRazorPages();
app.MapControllers();
//get version of database the software is configured to work with (appsettings.json)
app.MapGet("/db_version", async (NpgsqlDataSource db) =>
{