21 lines
408 B
Go
21 lines
408 B
Go
package cmd
|
|
|
|
import (
|
|
"git.bloy.org/mike/gotest/web"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
func init() {
|
|
rootCmd.AddCommand(runCmd)
|
|
runCmd.Flags().String("addr", ":8000", "Port to serve http")
|
|
}
|
|
|
|
var runCmd = &cobra.Command{
|
|
Use: "run",
|
|
Short: "Run the webserver",
|
|
Long: "Listen to the specified port and serve http until interrupted",
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
web.RunServer()
|
|
},
|
|
}
|