...docker test

This commit is contained in:
2026-06-18 18:35:56 -04:00
parent 5e1fe81473
commit 6a2a8abb22
31 changed files with 958 additions and 11 deletions
+43
View File
@@ -0,0 +1,43 @@
using Microsoft.EntityFrameworkCore;
using Server;
var builder = WebApplication.CreateBuilder(args);
builder.WebHost.UseStaticWebAssets();
// Add services to the container.
builder.Services.AddControllersWithViews();
builder.Services.AddRazorPages();
var connectionString = builder.Configuration.GetConnectionString("DefaultConnection");
builder.Services.AddDbContext<AppDbContext>(options =>
options.UseNpgsql(connectionString));
var app = builder.Build();
// Apply migrations
using (var scope = app.Services.CreateScope())
{
var db = scope.ServiceProvider.GetRequiredService<AppDbContext>();
db.Database.Migrate();
}
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseWebAssemblyDebugging();
}
else
{
app.UseExceptionHandler("/Error");
}
app.UseBlazorFrameworkFiles();
app.UseStaticFiles();
app.UseRouting();
app.MapRazorPages();
app.MapControllers();
app.MapFallbackToFile("index.html");
app.Run();