123456789101112131415161718192021222324252627282930 |
- package main
- import (
- "flag"
- "fmt"
- "ylink/bff/authbff/api/internal/config"
- "ylink/bff/authbff/api/internal/handler"
- "ylink/bff/authbff/api/internal/svc"
- "github.com/zeromicro/go-zero/core/conf"
- "github.com/zeromicro/go-zero/rest"
- )
- var configFile = flag.String("f", "etc/authbff.yaml", "the config file")
- func main() {
- flag.Parse()
- var c config.Config
- conf.MustLoad(*configFile, &c)
- ctx := svc.NewServiceContext(c)
- server := rest.MustNewServer(c.RestConf)
- defer server.Stop()
- handler.RegisterHandlers(server, ctx)
- fmt.Printf("Starting server at %s:%d...\n", c.Host, c.Port)
- server.Start()
- }
|