owl-blogs/cmd/owl/web.go

25 lines
413 B
Go
Raw Permalink Normal View History

2022-09-05 18:34:24 +00:00
package main
import (
web "h4kor/owl-blogs/cmd/owl/web"
"github.com/spf13/cobra"
)
var port int
func init() {
rootCmd.AddCommand(webCmd)
2022-09-05 18:59:32 +00:00
webCmd.PersistentFlags().IntVar(&port, "port", 8080, "Port to use")
2022-09-05 18:34:24 +00:00
}
var webCmd = &cobra.Command{
Use: "web",
Short: "Start the web server",
Long: `Start the web server`,
Run: func(cmd *cobra.Command, args []string) {
2022-09-05 18:59:32 +00:00
web.StartServer(repoPath, port)
2022-09-05 18:34:24 +00:00
},
}