Fix issues with connection strings
This commit is contained in:
parent
41c13b777e
commit
39521bf284
2
API/.gitignore
vendored
2
API/.gitignore
vendored
@ -1 +1,3 @@
|
||||
database.sqlite3*
|
||||
efbundle
|
||||
|
||||
|
@ -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<AppDBContext>(options => options.UseSqlite(connectionString));
|
||||
|
||||
Console.WriteLine("Connecting to database with connection string: " + connectionString);
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
|
Loading…
Reference in New Issue
Block a user