diff --git a/API/API.csproj b/API/API.csproj index f8d5136..04c1619 100644 --- a/API/API.csproj +++ b/API/API.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 enable enable diff --git a/API/Program.cs b/API/Program.cs index eae49c0..b3ced90 100644 --- a/API/Program.cs +++ b/API/Program.cs @@ -2,7 +2,13 @@ using API.Database; using API.Repository.AgeGroup; using Microsoft.EntityFrameworkCore; -var builder = WebApplication.CreateBuilder(args); +var webRoot = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), "..", "wwwroot")); + +var builder = WebApplication.CreateBuilder(new WebApplicationOptions +{ + Args = args, + WebRootPath = webRoot +}); builder.Services.AddControllers(); builder.Services.AddEndpointsApiExplorer(); @@ -43,10 +49,16 @@ using(var scope = app.Services.CreateScope()) dbContext.Database.Migrate(); } +// Deliver frontend +app.UseDefaultFiles(); +app.UseStaticFiles(); + app.UseHttpsRedirection(); app.UseAuthorization(); app.MapControllers(); +// Frontend Fallback +app.MapFallbackToFile("index.html"); app.Run(); diff --git a/API/app.db b/API/app.db index 459224a..ac5d8a8 100644 Binary files a/API/app.db and b/API/app.db differ