From 9b2b65a1527ce95417b9cadd8bfd8c120c0de14b Mon Sep 17 00:00:00 2001 From: Reimar Date: Wed, 19 Mar 2025 14:06:56 +0100 Subject: [PATCH] Fix errors on prod --- backend/Api/Program.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/Api/Program.cs b/backend/Api/Program.cs index ce4f270..02c216a 100644 --- a/backend/Api/Program.cs +++ b/backend/Api/Program.cs @@ -12,17 +12,21 @@ class Program app.Run(); } + // Calls the startup class and creates the webinterface public static IWebHostBuilder CreateWebHostBuilder(string[] args) => WebHost.CreateDefaultBuilder(args) - .UseUrls("0.0.0.0:5000") + .UseUrls("http://0.0.0.0:5000") .UseStartup(); public static async void RunMigrations(IWebHost app) { await using var scope = app.Services.CreateAsyncScope(); await using var db = scope.ServiceProvider.GetService(); - await db.Database.MigrateAsync(); + + if (db != null) { + await db.Database.MigrateAsync(); + } } }