mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-11 19:04:35 +00:00
26 lines
490 B
Go
26 lines
490 B
Go
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(), new(handler.Chat))
|
|
|
|
// Run the service
|
|
if err := srv.Run(); err != nil {
|
|
logger.Fatal(err)
|
|
}
|
|
}
|