Skip to content

Commit

Permalink
Readme docs answering question from mailing list on profilesvc (#709)
Browse files Browse the repository at this point in the history
  • Loading branch information
wadearnold authored and peterbourgon committed May 1, 2018
1 parent a142068 commit 828ac17
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions examples/profilesvc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,24 @@

This example demonstrates how to use Go kit to implement a REST-y HTTP service.
It leverages the excellent [gorilla mux package](https://github.com/gorilla/mux) for routing.

Run the example with the optional port address for the service:

```bash
$ go run ./cmd/profilesvc/main.go -http.addr :8080
ts=2018-05-01T16:13:12.849086255Z caller=main.go:47 transport=HTTP addr=:8080
```

Create a Profile:

```bash
$ curl -d '{"id":"1234","Name":"Go Kit"}' -H "Content-Type: application/json" -X POST http://localhost:8080/profiles/
{}
```

Get the profile you just created

```bash
$ curl localhost:8080/profiles/1234
{"profile":{"id":"1234","name":"Go Kit"}}
```

0 comments on commit 828ac17

Please sign in to comment.