odds-crawler-backend/cmd/main.go
2019-05-12 19:58:43 +09:00

25 lines
505 B
Go

package main
import (
"log"
"net"
pkg_cdp "git.loafle.net/odds_crawler/odds-crawler-backend/pkg/v1/cdp"
api_cdp "git.loafle.net/odds_crawler/odds-crawler-proto/pkg/api/v1/cdp"
"google.golang.org/grpc"
)
func main() {
lis, err := net.Listen("tcp", ":50051")
if err != nil {
log.Fatalf("failed to listen: %v", err)
}
s := grpc.NewServer()
api_cdp.RegisterCDPServiceServer(s, pkg_cdp.NewCDPServiceServer())
if err := s.Serve(lis); err != nil {
log.Fatalf("failed to serve: %v", err)
}
}