bottin-ag/cmd/api.go

32 lines
563 B
Go
Raw Normal View History

2023-09-15 13:14:43 -04:00
/*
Copyright © 2023 AGECEM & Victor Lacasse-Beaudoin
*/
package cmd
import (
"fmt"
2023-09-15 16:15:32 -04:00
"log"
2023-09-15 13:14:43 -04:00
2023-09-15 16:15:32 -04:00
"git.agecem.com/agecem/bottin-ag/config"
2023-09-15 13:14:43 -04:00
"github.com/spf13/cobra"
)
// apiCmd represents the api command
var apiCmd = &cobra.Command{
Use: "api",
Short: "Start the API server",
Run: func(cmd *cobra.Command, args []string) {
2023-09-15 16:15:32 -04:00
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)
2023-09-15 13:14:43 -04:00
},
}
func init() {
rootCmd.AddCommand(apiCmd)
}