added env config COUNTER_FILE, DEBUG
All checks were successful
Docker Release Build / push_to_registry (push) Successful in 59s
All checks were successful
Docker Release Build / push_to_registry (push) Successful in 59s
This commit is contained in:
16
main.go
16
main.go
@@ -27,6 +27,21 @@ var (
|
||||
mu sync.Mutex
|
||||
)
|
||||
|
||||
func initConfig() {
|
||||
// 1. Counter-Pfad auslesen
|
||||
if envFile := os.Getenv("COUNTER_FILE"); envFile != "" {
|
||||
counterFile = envFile
|
||||
log.Printf("counterFile st to %s, by ENV\n", envFile)
|
||||
}
|
||||
|
||||
// 2. Debug-Modus auslesen (String zu Bool)
|
||||
envDebug := strings.ToLower(os.Getenv("DEBUG"))
|
||||
if envDebug == "true" || envDebug == "1" {
|
||||
debug = true
|
||||
log.Println("DEBUG-Modus ist aktiviert")
|
||||
}
|
||||
}
|
||||
|
||||
type responseWriter struct {
|
||||
http.ResponseWriter
|
||||
statusCode int
|
||||
@@ -214,6 +229,7 @@ func helpHandler(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
func main() {
|
||||
initConfig()
|
||||
loadTemplates()
|
||||
mux := http.NewServeMux()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user