Chat Handler

This commit is contained in:
Ben Toogood
2020-10-15 12:28:27 +01:00
parent 78c19be63a
commit 68f3e52656
7 changed files with 814 additions and 4 deletions

25
chat/main.go Normal file
View File

@@ -0,0 +1,25 @@
package main
import (
"github.com/micro/micro/v3/service"
"github.com/micro/micro/v3/service/logger"
"github.com/micro/services/chat/handler"
pb "github.com/micro/services/chat/proto"
)
func main() {
// Create the service
srv := service.New(
service.Name("chat"),
service.Version("latest"),
)
// Register the handler against the server
pb.RegisterChatHandler(srv.Server(), handler.New())
// Run the service
if err := srv.Run(); err != nil {
logger.Fatal(err)
}
}