Skip to content

Commit

Permalink
[Docs][PrebidServer] Adding /version doc (#1198)
Browse files Browse the repository at this point in the history
This CL introduces documentation for the `/version` admin endpoint.

Issue: #1197
  • Loading branch information
benjaminch authored and bretg committed Jun 10, 2019
1 parent a0e49dd commit e5f051a
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions prebid-server/endpoints/version.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
## `GET /version`

This endpoint exposes the application version as defined at compilation time.
Version can be set either:
- manually using go build -ldflags "-X main.Rev=`git rev-parse --short HEAD`"
- automatically via .travis.yml configuration
See https://github.com/prebid/prebid-server/blob/master/pbs_light.go:

```go
// Holds binary revision string
// Set manually at build time using:
// go build -ldflags "-X main.Rev=`git rev-parse --short HEAD`"
// Populated automatically at build / release time via .travis.yml
// `gox -os="linux" -arch="386" -output="{{.Dir}}_{{.OS}}_{{.Arch}}" -ldflags "-X main.Rev=`git rev-parse --short HEAD`" -verbose ./...;`
// See issue #559
var Rev string
```

### Sample responses

#### Version set
```json
{"revision": "d6cd1e2bd19e03a81132a23b2025920577f84e37"},
```

#### Version not set
```json
{"revision": "not-set"}`
```

0 comments on commit e5f051a

Please sign in to comment.