gateway.tpl 338 B

1234567891011121314151617181920
  1. package main
  2. import (
  3. "flag"
  4. "github.com/zeromicro/go-zero/core/conf"
  5. "github.com/zeromicro/go-zero/gateway"
  6. )
  7. var configFile = flag.String("f", "etc/gateway.yaml", "config file")
  8. func main() {
  9. flag.Parse()
  10. var c gateway.GatewayConf
  11. conf.MustLoad(*configFile, &c)
  12. gw := gateway.MustNewServer(c)
  13. defer gw.Stop()
  14. gw.Start()
  15. }