Opt: move init gin mod to bootstrap

pull/21/head
zijiren233 1 year ago
parent 6af3409727
commit 3bedc6ed41

@ -24,14 +24,14 @@ var ServerCmd = &cobra.Command{
bootstrap.InitSysNotify,
bootstrap.InitConfig,
bootstrap.InitLog,
bootstrap.InitGinMode,
)
if !flags.DisableUpdateCheck {
boot.Add(bootstrap.InitCheckUpdate)
}
return boot.Run()
},
PreRunE: func(cmd *cobra.Command, args []string) error { return InitGinMode() },
Run: Server,
Run: Server,
}
func Server(cmd *cobra.Command, args []string) {

@ -1,11 +1,13 @@
package cmd
package bootstrap
import (
"context"
"github.com/gin-gonic/gin"
"github.com/synctv-org/synctv/cmd/flags"
)
func InitGinMode() error {
func InitGinMode(ctx context.Context) error {
if flags.Dev {
gin.SetMode(gin.DebugMode)
} else {
Loading…
Cancel
Save