Add debug logging to track configuration loading
This commit is contained in:
parent
9350811e55
commit
ef391d93d9
@ -31,20 +31,23 @@ export class SiteConfigManager {
|
||||
constructor() {
|
||||
this.loadConfigurations();
|
||||
}
|
||||
|
||||
private loadConfigurations() {
|
||||
// Lade Konfigurationen aus Umgebungsvariablen oder JSON-Dateien
|
||||
const configsJson = process.env.SITES_CONFIG;
|
||||
console.log('Loading site configurations...');
|
||||
console.log('SITES_CONFIG exists:', !!configsJson);
|
||||
if (configsJson) {
|
||||
try {
|
||||
const configs = JSON.parse(configsJson);
|
||||
console.log('Parsed configurations:', Object.keys(configs));
|
||||
for (const [domain, config] of Object.entries(configs)) {
|
||||
this.configs.set(domain, config as SiteConfig);
|
||||
}
|
||||
console.log('Loaded', this.configs.size, 'site configurations');
|
||||
} catch (error) {
|
||||
console.error('Fehler beim Laden der Site-Konfigurationen:', error);
|
||||
}
|
||||
} // Fallback-Konfiguration für die aktuelle Site
|
||||
}// Fallback-Konfiguration für die aktuelle Site
|
||||
if (this.configs.size === 0) {
|
||||
console.log('Using fallback configuration as no SITES_CONFIG found');
|
||||
this.configs.set('ed.pixelbrew.de', {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user