mirror of
https://github.com/lorsanstand/HomeOps-Hub.git
synced 2026-06-19 16:45:15 +03:00
26 lines
432 B
Go
26 lines
432 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
"net"
|
|
|
|
"github.com/lorsanstand/HomeOps-Hub/api/gen/homeops"
|
|
grpcserver "github.com/lorsanstand/HomeOps-Hub/internal/hub/grpc"
|
|
"google.golang.org/grpc"
|
|
)
|
|
|
|
func main() {
|
|
lis, err := net.Listen("tcp", ":6756")
|
|
if err != nil {
|
|
return
|
|
}
|
|
|
|
grpcServer := grpc.NewServer()
|
|
|
|
srv := &grpcserver.Server{}
|
|
homeops.RegisterHubServer(grpcServer, srv)
|
|
|
|
log.Println("Start serve")
|
|
grpcServer.Serve(lis)
|
|
}
|