Appeler config.GetConfig dans apiCmd
This commit is contained in:
parent
2bdb22d956
commit
3ba1231723
1 changed files with 9 additions and 1 deletions
10
cmd/api.go
10
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)
|
||||
},
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue