Draft: poop
This commit is contained in:
32
cmds/game.go
Normal file
32
cmds/game.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package cmds
|
||||
|
||||
import (
|
||||
"inp2025/workflows"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
var gameCmd = &cobra.Command{
|
||||
Use: "game",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
router := workflows.GameServer()
|
||||
|
||||
err := router.Listen(":" + viper.GetString("port"))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
zap.L().Info("server up",
|
||||
zap.String("addr", router.ListenAddr()))
|
||||
if err := router.WaitFor(); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
func init() {
|
||||
gameCmd.Flags().
|
||||
String("port", "12345", "")
|
||||
}
|
||||
Reference in New Issue
Block a user