Last active
September 20, 2015 07:29
-
-
Save IndianGuru/0b91438129f271b99407 to your computer and use it in GitHub Desktop.
Register the services
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
| func init() { | |
| // register the quotes API with cloud endpoints. | |
| api, err := endpoints.RegisterService(QuotesAPI{}, "quotesService", "v1", "Quotes API", true) | |
| if err != nil { | |
| panic(err) | |
| } | |
| // adapt the name, method, and path for each method. | |
| info := api.MethodByName("List").Info() | |
| info.Name, info.HTTPMethod, info.Path = "getQuotes", "GET", "quotesService" | |
| info = api.MethodByName("Add").Info() | |
| info.Name, info.HTTPMethod, info.Path = "addQuote", "POST", "quotesService" | |
| // start handling cloud endpoint requests. | |
| endpoints.HandleHTTP() | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment