How it works...

Once we run the program, the HTTP server will start locally listening on port 8080.

Next, browse to http://localhost:8080/greeter/say/hello?name=Arpit+Aggarwal as follows:

This will give you the response Hello followed by the name received as an HTTP request variable. Moreover, looking at the logs of the second-greeting-service.go will show us the request is served by the second greeting service, as follows:

Now, if we execute a GET request again then it will print the logs in the first-greeting-service.go console, which is ...

Get Go Web Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.