fusenapi/server/data-transfer/data-transfer.go
laodaming a9e0f6b98e fix
2023-06-08 11:03:20 +08:00

31 lines
670 B
Go

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