youtu_server/game_open_api/game_open_api.go

31 lines
730 B
Go
Raw Permalink Normal View History

2025-01-20 01:55:44 +08:00
package main
import (
"flag"
"fmt"
"gitea.youtukeji.com.cn/xiabin/youtu_server/game_open_api/internal/config"
"gitea.youtukeji.com.cn/xiabin/youtu_server/game_open_api/internal/handler"
"gitea.youtukeji.com.cn/xiabin/youtu_server/game_open_api/internal/svc"
2025-01-20 01:55:44 +08:00
"github.com/zeromicro/go-zero/core/conf"
"github.com/zeromicro/go-zero/rest"
)
2025-01-21 16:54:00 +08:00
var configFile = flag.String("f", "etc/game_open_api-api.yaml", "the config file")
2025-01-20 01:55:44 +08:00
func main() {
flag.Parse()
var c config.Config
conf.MustLoad(*configFile, &c)
server := rest.MustNewServer(c.RestConf)
defer server.Stop()
ctx := svc.NewServiceContext(c)
handler.RegisterHandlers(server, ctx)
fmt.Printf("Starting server at %s:%d...\n", c.Host, c.Port)
server.Start()
}