22 lines
519 B
C#
22 lines
519 B
C#
using backend.Data;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
builder.Services.AddDbContext<AppDbContext>(opt =>
|
|
opt.UseSqlite(builder.Configuration.GetConnectionString("Default")));
|
|
|
|
var app = builder.Build();
|
|
|
|
using (var scope = app.Services.CreateScope())
|
|
{
|
|
var db = scope.ServiceProvider.GetRequiredService<AppDbContext>();
|
|
db.Database.Migrate();
|
|
}
|
|
|
|
app.MapGet("/health", () => Results.Ok(new { ok = true }));
|
|
|
|
app.Run();
|
|
|
|
public partial class Program { }
|