Files
crawlab/core/cmd/server.go
Marvin Zhang a13893b627 feat: add logo printing functionality and update logger usage
- Introduced a new utility function to print a logo and welcome information for the Crawlab server, enhancing user experience during startup.
- Updated logger variable names in the apps package for consistency and clarity.
- Added a new dependency on github.com/common-nighthawk/go-figure to facilitate logo rendering.
- Improved the server command to display the logo when the server starts, provided the user is not using the pro version.
2024-12-25 13:08:56 +08:00

31 lines
606 B
Go

package cmd
import (
"github.com/crawlab-team/crawlab/core/apps"
"github.com/crawlab-team/crawlab/core/utils"
"github.com/spf13/cobra"
)
func init() {
rootCmd.AddCommand(serverCmd)
}
var serverCmd = &cobra.Command{
Use: "server",
Aliases: []string{"s"},
Short: "Start Crawlab server",
Long: `Start Crawlab node server that can serve as API, task scheduler, task runner, etc.`,
Run: func(cmd *cobra.Command, args []string) {
// print logo if not pro
if !utils.IsPro() {
utils.PrintLogoWithWelcomeInfo()
}
// app
svr := apps.GetServer()
// start
apps.Start(svr)
},
}