routes and handlker for PDFexport created

This commit is contained in:
2025-12-20 18:32:48 +01:00
parent 58692f54d6
commit 915352c0f3
8 changed files with 380 additions and 5 deletions
+10 -1
View File
@@ -25,6 +25,9 @@ type Config struct {
Environment string
DevTesting string // "yes" or "no", used to determine if we are in a test environment
// PDF Templates
TemplatesDir string // Directory where PDF templates are stored
}
// Cfg ist die globale Konfigurationsvariable
@@ -45,7 +48,8 @@ func defaultConfig() *Config {
DebugMode: false,
LogLevel: "INFO",
Environment: "production",
DevTesting: "no", // Default to "no", can be overridden in tests
DevTesting: "no", // Default to "no", can be overridden in tests
TemplatesDir: "./templates", // Default templates directory
}
}
@@ -111,6 +115,11 @@ func LoadConfig() *Config {
fmt.Printf("DEBUG LoadConfig - DEVTESTING nicht gefunden, setze DevTesting auf 'no'\n")
}
// Templates Directory
if templatesDir := os.Getenv("TEMPLATES_DIR"); templatesDir != "" {
config.TemplatesDir = templatesDir
}
fmt.Printf("DEBUG LoadConfig - Finale Config: Environment='%s', DevTesting='%s', DatabaseType='%s'\n",
config.Environment, config.DevTesting, config.DatabaseType)