From 39521bf284c9878809c35e65f034357a8113f59f Mon Sep 17 00:00:00 2001 From: Reimar Date: Tue, 13 Aug 2024 19:08:30 +0200 Subject: [PATCH] Fix issues with connection strings --- API/.gitignore | 4 +++- API/Program.cs | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/API/.gitignore b/API/.gitignore index b9f9133..cddb4f0 100644 --- a/API/.gitignore +++ b/API/.gitignore @@ -1 +1,3 @@ -database.sqlite3* \ No newline at end of file +database.sqlite3* +efbundle + diff --git a/API/Program.cs b/API/Program.cs index 1340f7a..c239519 100644 --- a/API/Program.cs +++ b/API/Program.cs @@ -37,9 +37,11 @@ namespace API IConfiguration Configuration = builder.Configuration; - var connectionString = Configuration.GetConnectionString("DefaultConnection") ?? Environment.GetEnvironmentVariable("DefaultConnection"); + var connectionString = Configuration.GetConnectionString("DefaultConnection") ?? Environment.GetEnvironmentVariable("DEFAULT_CONNECTION"); builder.Services.AddDbContext(options => options.UseSqlite(connectionString)); + Console.WriteLine("Connecting to database with connection string: " + connectionString); + var app = builder.Build(); // Configure the HTTP request pipeline.