Files
crawlab/backend/cmd/api.go
marvzhang 1c0aba161c added cli
2021-04-27 11:34:12 +08:00

22 lines
355 B
Go

package cmd
import (
"crawlab/apps"
"github.com/spf13/cobra"
)
func init() {
rootCmd.AddCommand(apiCmd)
}
var apiCmd = &cobra.Command{
Use: "api",
Short: "Start API server",
Long: `Start API server of Crawlab which serves data to frontend`,
Run: func(cmd *cobra.Command, args []string) {
api := apps.NewApi()
api.Init()
api.Run()
},
}