This repository has been archived on 2024-12-15. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
bottin-ag/cmd/api.go

31 lines
563 B
Go

/*
Copyright © 2023 AGECEM & Victor Lacasse-Beaudoin
*/
package cmd
import (
"fmt"
"log"
"git.agecem.com/agecem/bottin-ag/config"
"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) {
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)
},
}
func init() {
rootCmd.AddCommand(apiCmd)
}