This commit is contained in:
2024-05-19 18:42:30 +07:00
parent db4419dc81
commit 05b10895d3
3 changed files with 26 additions and 13 deletions
+3 -3
View File
@@ -3,7 +3,7 @@ package main
import (
"cake_crm/internal/app"
"cake_crm/internal/models/storage/storage_file"
crm "cake_crm/proto"
proto "cake_crm/proto"
"context"
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"google.golang.org/grpc"
@@ -29,7 +29,7 @@ func main() {
// Create a gRPC server object
s := grpc.NewServer()
// Attach the Greeter service to the server
crm.RegisterCRMServer(s, app.NewServer(storage))
proto.RegisterCRMServer(s, app.NewServer(storage))
// Serve gRPC server
log.Println("Serving gRPC on 0.0.0.0:8080")
go func() {
@@ -48,7 +48,7 @@ func main() {
gwmux := runtime.NewServeMux()
// Register Greeter
err = crm.RegisterCRMHandler(context.Background(), gwmux, conn)
err = proto.RegisterCRMHandler(context.Background(), gwmux, conn)
if err != nil {
log.Fatalln("Failed to register gateway:", err)
}