print message when starting api server

This commit is contained in:
kevin
2020-09-16 13:27:16 +08:00
parent a50bcb90a6
commit a561884fcf
6 changed files with 112 additions and 112 deletions

View File

@@ -4,15 +4,16 @@
package main
import (
"flag"
"fmt"
"bookstore/rpc/add/internal/config"
"bookstore/rpc/add/internal/server"
"bookstore/rpc/add/internal/svc"
add "bookstore/rpc/add/pb"
"flag"
"fmt"
"log"
"github.com/tal-tech/go-zero/core/conf"
"github.com/tal-tech/go-zero/core/logx"
"github.com/tal-tech/go-zero/rpcx"
"google.golang.org/grpc"
)
@@ -30,9 +31,7 @@ func main() {
s, err := rpcx.NewServer(c.RpcServerConf, func(grpcServer *grpc.Server) {
add.RegisterAdderServer(grpcServer, adderSrv)
})
if err != nil {
log.Fatal(err)
}
logx.Must(err)
fmt.Printf("Starting rpc server at %s...\n", c.ListenOn)
s.Start()

View File

@@ -4,15 +4,16 @@
package main
import (
"flag"
"fmt"
"bookstore/rpc/check/internal/config"
"bookstore/rpc/check/internal/server"
"bookstore/rpc/check/internal/svc"
check "bookstore/rpc/check/pb"
"flag"
"fmt"
"log"
"github.com/tal-tech/go-zero/core/conf"
"github.com/tal-tech/go-zero/core/logx"
"github.com/tal-tech/go-zero/rpcx"
"google.golang.org/grpc"
)
@@ -30,9 +31,7 @@ func main() {
s, err := rpcx.NewServer(c.RpcServerConf, func(grpcServer *grpc.Server) {
check.RegisterCheckerServer(grpcServer, checkerSrv)
})
if err != nil {
log.Fatal(err)
}
logx.Must(err)
fmt.Printf("Starting rpc server at %s...\n", c.ListenOn)
s.Start()