mirror of
https://github.com/RedWizardsLab/EchoHub.git
synced 2026-09-04 23:34:10 +02:00
fix: Update connection string handling to allow for empty configuration
This commit is contained in:
@@ -39,8 +39,10 @@ while (true)
|
||||
|
||||
// ── SQLite + EF Core ─────────────────────────────────────────────────
|
||||
var defaultDbPath = Path.Combine(AppContext.BaseDirectory, "echohub.db");
|
||||
var connectionString = builder.Configuration.GetConnectionString("DefaultConnection")
|
||||
?? $"Data Source={defaultDbPath}";
|
||||
var configured = builder.Configuration.GetConnectionString("DefaultConnection");
|
||||
var connectionString = string.IsNullOrWhiteSpace(configured)
|
||||
? $"Data Source={defaultDbPath}"
|
||||
: configured;
|
||||
|
||||
builder.Services.AddDbContext<EchoHubDbContext>(options =>
|
||||
options.UseSqlite(connectionString));
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"Urls": "http://0.0.0.0:5000",
|
||||
"ConnectionStrings": {
|
||||
"DefaultConnection": "Data Source=echohub.db"
|
||||
"DefaultConnection": ""
|
||||
},
|
||||
"Jwt": {
|
||||
"Secret": "CHANGE_ME_minimum_32_characters_long_secret_key",
|
||||
|
||||
Reference in New Issue
Block a user