Files
backend/cmds/root.go
Yi-Ting Shih 1cf3a9ef0b
All checks were successful
Go test / run-go-vet (push) Successful in 6s
Go test / check-swagger-up-to-date (push) Successful in 10s
Go test / run-go-test (push) Successful in 36s
Go test / cleanup-go-test (push) Successful in 14s
Go test / release-image (push) Successful in 3m20s
Fix: cookie timeout
2025-12-12 02:09:46 +08:00

26 lines
473 B
Go

package cmds
import (
"strings"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
var RootCmd = &cobra.Command{
Use: "root",
PersistentPreRun: func(cmd *cobra.Command, args []string) {
viper.AutomaticEnv()
viper.SetEnvKeyReplacer(strings.NewReplacer("-", "_"))
viper.BindPFlags(cmd.PersistentFlags())
viper.BindPFlags(cmd.Flags())
},
}
func init() {
cobra.EnableTraverseRunHooks = true
RootCmd.AddCommand(serveCmd)
RootCmd.AddCommand(genTokenCmd)
}