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(); + } } }