woj-server/cmd/app/run.go

22 lines
390 B
Go
Raw Normal View History

2022-09-08 22:00:25 +08:00
package main
import (
2022-10-13 16:32:44 +08:00
"github.com/WHUPRJ/woj-server/global"
2022-09-08 22:00:25 +08:00
"github.com/WHUPRJ/woj-server/internal/app"
"github.com/urfave/cli/v2"
"math/rand"
"time"
)
func run(c *cli.Context) error {
rand.Seed(time.Now().Unix())
g := new(global.Global)
g.SetupConfig(c.String("config"))
g.SetupZap()
defer func() { _ = g.Log.Sync() }()
g.Log.Info("starting server...")
return app.Run(g)
}