pastebin/cmd/api.go

22 lines
414 B
Go
Raw Normal View History

2023-09-30 13:47:59 +00:00
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)
}
},
}
)