pastebin/cmd/api.go
2023-09-30 21:47:59 +08:00

22 lines
414 B
Go

package cmd
import (
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"pastebin/register"
)
var (
apiServerCommand = &cobra.Command{
Use: "api",
Short: "start api server",
Long: "start api server",
Run: func(cmd *cobra.Command, args []string) {
router := register.NewRouter()
if err := router.Register(); err != nil {
logrus.Errorf("register router failed: %v", err)
}
},
}
)