Invoking the API via a client library

The social graph manager is now accessible through an HTTP REST API. Here is a quick local demo. First, I will launch the Postgres DB (I have a Docker image called postgres), which is used as the data store, and then I will run the service itself in the service directory, that is, delinkcious/svc/social_graph_service:

$ docker restart postgres$ go run main.go2018/12/31 10:41:23 Listening on port 9090...

Let's add a couple of follower/following relationships by invoking the /follow endpoint. I will use the excellent HTTPie (https://httpie.org/), which is a better curl in my honest opinion. However, you can use curl if you prefer:

$ http POST http://localhost:9090/follow followed=liat follower=gigiHTTP/1.1 ...

Get Hands-On Microservices with Kubernetes 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.