diff options
| author | exatombe <jeremy27.clara22@gmail.com> | 2025-11-03 00:01:52 +0100 | 
|---|---|---|
| committer | exatombe <jeremy27.clara22@gmail.com> | 2025-11-03 00:01:52 +0100 | 
| commit | f232228974b12b1c2b5b07718532eec26a88841d (patch) | |
| tree | 2fc8127e5248c59ff6596bfafcda30965d3e7dc5 /cmd/server | |
| parent | 549a8b6b8c97c357495c9df198c21e940f56b6a5 (diff) | |
feat: ajouter la configuration de l'utilisateur super et améliorer la gestion de la configuration
Diffstat (limited to 'cmd/server')
| -rw-r--r-- | cmd/server/main.go | 11 | 
1 files changed, 9 insertions, 2 deletions
diff --git a/cmd/server/main.go b/cmd/server/main.go index 91c1d75..870bd7c 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -3,6 +3,7 @@ package main  import (  	"log"  	"net/http" +	"os"  	mux "github.com/gorilla/mux"  	"github.com/ketsuna-org/sovrabase/internal/config" @@ -10,9 +11,15 @@ import (  )  func main() { -	cfg, err := config.LoadConfig("config.yaml") +	// Get config path from environment variable or use default +	configPath := os.Getenv("CONFIG_PATH") +	if configPath == "" { +		configPath = "config.yaml" +	} + +	cfg, err := config.LoadConfig(configPath)  	if err != nil { -		log.Fatalf("failed to load config: %v", err) +		log.Fatalf("failed to load config from %s: %v", configPath, err)  	}  	// Setup HTTP Server  | 
