fusenapi/goctl_template_backend/gateway/main.tpl

22 lines
376 B
Smarty
Raw Normal View History

2023-06-25 10:30:39 +00:00
package main
import (
"flag"
"github.com/zeromicro/go-zero/core/conf"
"github.com/zeromicro/go-zero/gateway"
)
var configFile = flag.String("f", "etc/gateway.yaml", "config file")
func main() {
flag.Parse()
var c gateway.GatewayConf
2023-07-12 02:22:03 +00:00
conf.MustLoad(*configFile, &c)
c.Timeout = int64(time.Second * 15)
2023-06-25 10:30:39 +00:00
gw := gateway.MustNewServer(c)
defer gw.Stop()
gw.Start()
}