Refactor AppConfig and update configuration settings across environments. Changed properties to use set accessors, added AllowedOrigins, and improved error handling in Program.cs. Updated appsettings files for development, production, and added new structure for user data retrieval.
This commit is contained in:
@@ -2,16 +2,17 @@ namespace DexDemoBackend;
|
||||
|
||||
public class AppConfig
|
||||
{
|
||||
public string DbHost { get; init; } = default!;
|
||||
public string DbPort { get; init; } = default!;
|
||||
public string DbName { get; init; } = default!;
|
||||
public string DbUser { get; init; } = default!;
|
||||
public string DbPassword { get; init; } = default!;
|
||||
public string Issuer { get; init; } = default!;
|
||||
public bool InsecureDevMode { get; init; }
|
||||
public string? InsecureDevEmail { get; init; }
|
||||
|
||||
public string ConnectionString =>
|
||||
public string DbHost { get; set; } = "postgres";
|
||||
public string DbPort { get; set; } = "5440";
|
||||
public string DbName { get; set; } = "dexdemo";
|
||||
public string DbUser { get; set; } = "dexdemo";
|
||||
public string DbPassword { get; set; } = "dexdemo";
|
||||
public string Issuer { get; set; } = "https://dex.127.0.0.1.sslip.io/";
|
||||
public bool InsecureDevMode { get; set; }
|
||||
public string? InsecureDevEmail { get; set; }
|
||||
public string[] AllowedOrigins { get; set; } = ["http://localhost:3000", "https://localhost:3000"];
|
||||
|
||||
public string ConnectionString =>
|
||||
$"Host={DbHost};Port={DbPort};Database={DbName};Username={DbUser};Password={DbPassword}";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user