From 3ba12317232c6af4d1b2f61e2a12f5934fe4bf98 Mon Sep 17 00:00:00 2001 From: Victor Lacasse-Beaudoin Date: Fri, 15 Sep 2023 16:15:32 -0400 Subject: [PATCH] Appeler config.GetConfig dans apiCmd --- cmd/api.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cmd/api.go b/cmd/api.go index 1cd3f14..e9779d0 100644 --- a/cmd/api.go +++ b/cmd/api.go @@ -5,7 +5,9 @@ package cmd import ( "fmt" + "log" + "git.agecem.com/agecem/bottin-ag/config" "github.com/spf13/cobra" ) @@ -14,7 +16,13 @@ var apiCmd = &cobra.Command{ Use: "api", Short: "Start the API server", Run: func(cmd *cobra.Command, args []string) { - fmt.Println("api called") + cfg, err := config.GetConfig() + if err != nil { + log.Fatal(err) + } + + fmt.Println("api called with api-port", cfg.API.Port) + fmt.Println("api called with web-port", cfg.Web.Port) }, }