mirror of
https://github.com/SourceFellows/gobuch.git
synced 2025-07-20 07:02:53 +02:00
initial import
This commit is contained in:
18
microservices/grpc/server/cmd/main.go
Normal file
18
microservices/grpc/server/cmd/main.go
Normal file
@ -0,0 +1,18 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"net"
|
||||
|
||||
"golang.source-fellows.com/samples/grpc/hello"
|
||||
"golang.source-fellows.com/samples/grpc/server"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
func main() {
|
||||
srv := grpc.NewServer()
|
||||
hello.RegisterHelloWorldServiceServer(srv, &server.HelloService{})
|
||||
listener, _ := net.Listen("tcp", ":8080")
|
||||
log.Println("Starting Server ...")
|
||||
log.Fatal(srv.Serve(listener))
|
||||
}
|
Reference in New Issue
Block a user