Skip to content

Commit

Permalink
feat(grpc): implement the api by grpc
Browse files Browse the repository at this point in the history
  • Loading branch information
CorrectRoadH committed Dec 11, 2023
1 parent 62a60b5 commit 7a1d83c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/likit.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
4 changes: 4 additions & 0 deletions internal/adapter/in/grpc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,7 @@ func NewGrpcServer(voteGRPCServer *VoteGRPCServer) *GrpcServer {
listener: lis,
}
}

func (s *GrpcServer) Start() error {
return s.Server.Serve(s.listener)
}

0 comments on commit 7a1d83c

Please sign in to comment.