Created
December 8, 2020 16:04
-
-
Save jmrobles/bc56a4919909a2037bfeb32b9cba9381 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"helloworld/handler" | |
pb "helloworld/proto" | |
"github.com/micro/micro/v3/service" | |
"github.com/micro/micro/v3/service/logger" | |
) | |
func main() { | |
// Create service | |
srv := service.New( | |
service.Name("helloworld"), | |
service.Version("latest"), | |
) | |
// Register handler | |
pb.RegisterHelloworldHandler(srv.Server(), new(handler.Helloworld)) | |
// Run service | |
if err := srv.Run(); err != nil { | |
logger.Fatal(err) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment