diff --git a/cmd/likit.go b/cmd/likit.go index 5160cb8..ac1bafb 100644 --- a/cmd/likit.go +++ b/cmd/likit.go @@ -39,7 +39,8 @@ func Main() { database.NewPostgresAdapter, ), fx.Invoke(func(s *restful.RESTfulServer, g *grpc.GrpcServer) { - s.Start() + go s.Start() + go g.Start() }), ).Run() diff --git a/internal/adapter/in/grpc/server.go b/internal/adapter/in/grpc/server.go index 1443956..88b78ef 100644 --- a/internal/adapter/in/grpc/server.go +++ b/internal/adapter/in/grpc/server.go @@ -36,3 +36,7 @@ func NewGrpcServer(voteGRPCServer *VoteGRPCServer) *GrpcServer { listener: lis, } } + +func (s *GrpcServer) Start() error { + return s.Server.Serve(s.listener) +}