Redmage/cli/serve.go

24 lines
477 B
Go
Raw Normal View History

2024-04-06 01:22:00 +07:00
package cli
2024-04-07 12:11:25 +07:00
import (
"github.com/spf13/cobra"
"github.com/tigorlazuardi/redmage/pkg/log"
)
2024-04-06 01:22:00 +07:00
var serveCmd = &cobra.Command{
Use: "serve",
Short: "Starts the HTTP Server",
SilenceUsage: true,
RunE: func(cmd *cobra.Command, args []string) error {
2024-04-07 12:11:25 +07:00
hostPort := cfg.String("http.host") + ":" + cfg.String("http.port")
log.Log(cmd.Context()).Info("starting http server", "host", hostPort)
2024-04-06 01:22:00 +07:00
return nil
},
}
func init() {
RootCmd.AddCommand(serveCmd)
}