Last active
August 2, 2016 07:07
-
-
Save nodirt/d346d8708d05cff8b2ea to your computer and use it in GitHub Desktop.
This file contains 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
// init registers HTTP routes. | |
func init() { | |
// pRPC uses luci-go router that implements http.Handler. | |
r := router.New() | |
// We use no middleware in this example. | |
middleware := router.MiddlewareChain{} | |
// Configure pRPC server. | |
var server prpc.Server | |
server.Authenticator = prpc.NoAuthenticator | |
helloworld.RegisterGreeterServer(&server, &greeterService{}) | |
discovery.Enable(&server) | |
server.InstallHandlers(r, middleware) | |
// Plug the router into std HTTP stack. | |
http.DefaultServeMux.Handle("/", r) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment