Interacting with microservices using a command-line interface and web UI
So far, we have used the command line to execute GET
and POST
HTTP requests to access services. This can also be achieved by way of the Go Micro web user interface as well. All we need to do is start micro web
, which we will be covering in this recipe.
How to do it…
- Install the
go get github.com/micro/micro
package using thego get
command, as follows:
$ go get github.com/micro/micro
- Run the web UI with the following command:
$ micro web
How it works…
Once a command has executed successfully, browsing to http://localhost:8082/registry
will list all the registered services as shown in the following screenshot:

Querying our greeter
service using the web UI with the request {"name" : "Arpit Aggarwal"}
will render you the response, {"msg": "Hello Arpit Aggarwal"}
:

Querying the same greeter
service using a CLI
command, query go.micro.service.greeter Say.Hello {"name" : "Arpit Aggarwal"}
will render you the response, {"msg": "Hello...