You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
API/src/HeartTrackAPI/Program.cs

25 lines
619 B

using DbContextLib;
using HeartTrackAPI.Utils;
using StubbedContextLib;
var builder = WebApplication.CreateBuilder(args);
builder.Logging.AddConsole();
builder.WebHost.ConfigureKestrel(serverOptions =>
{
serverOptions.Limits.MaxRequestBodySize = long.MaxValue;
});
var init = new AppBootstrap(builder.Configuration);
init.ConfigureServices(builder.Services);
var app = builder.Build();
init.Configure(app, app.Environment);
var context = app.Services.GetService<HeartTrackContext>() ?? app.Services.GetService<TrainingStubbedContext>();
context!.Database.EnsureCreated();
app.Run();