forked from ReiMerc/skantravels
Fix issues with connection strings
This commit is contained in:
parent
9879ececa4
commit
8d20f7d651
4
API/.gitignore
vendored
4
API/.gitignore
vendored
@ -1 +1,3 @@
|
|||||||
database.sqlite3*
|
database.sqlite3*
|
||||||
|
efbundle
|
||||||
|
|
||||||
|
@ -37,9 +37,11 @@ namespace API
|
|||||||
|
|
||||||
IConfiguration Configuration = builder.Configuration;
|
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));
|
builder.Services.AddDbContext<AppDBContext>(options => options.UseSqlite(connectionString));
|
||||||
|
|
||||||
|
Console.WriteLine("Connecting to database with connection string: " + connectionString);
|
||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
|
||||||
// Configure the HTTP request pipeline.
|
// Configure the HTTP request pipeline.
|
||||||
|
Loading…
Reference in New Issue
Block a user