PDF generation and downloads are working
This commit is contained in:
@@ -27,7 +27,8 @@ type Config struct {
|
||||
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
|
||||
TemplatesDir string // Directory where PDF templates are stored
|
||||
ExportTempDir string // Directory for temporary PDF exports
|
||||
}
|
||||
|
||||
// Cfg ist die globale Konfigurationsvariable
|
||||
@@ -42,14 +43,15 @@ func init() {
|
||||
// defaultConfig gibt die Standard-Konfiguration zurück
|
||||
func defaultConfig() *Config {
|
||||
return &Config{
|
||||
ServerPort: "8180",
|
||||
DatabaseURL: "",
|
||||
DatabaseType: "mysql",
|
||||
DebugMode: false,
|
||||
LogLevel: "INFO",
|
||||
Environment: "production",
|
||||
DevTesting: "no", // Default to "no", can be overridden in tests
|
||||
TemplatesDir: "./templates", // Default templates directory
|
||||
ServerPort: "8180",
|
||||
DatabaseURL: "",
|
||||
DatabaseType: "mysql",
|
||||
DebugMode: false,
|
||||
LogLevel: "INFO",
|
||||
Environment: "production",
|
||||
DevTesting: "no", // Default to "no", can be overridden in tests
|
||||
TemplatesDir: "./templates", // Default templates directory
|
||||
ExportTempDir: "./xporttemp", // Default export temp directory
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,6 +122,11 @@ func LoadConfig() *Config {
|
||||
config.TemplatesDir = templatesDir
|
||||
}
|
||||
|
||||
// Export Temp Directory
|
||||
if exportTempDir := os.Getenv("EXPORT_TEMP_DIR"); exportTempDir != "" {
|
||||
config.ExportTempDir = exportTempDir
|
||||
}
|
||||
|
||||
fmt.Printf("DEBUG LoadConfig - Finale Config: Environment='%s', DevTesting='%s', DatabaseType='%s'\n",
|
||||
config.Environment, config.DevTesting, config.DatabaseType)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user