-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Docs][PrebidServer] Adding
/version
doc (#1198)
This CL introduces documentation for the `/version` admin endpoint. Issue: #1197
- Loading branch information
1 parent
a0e49dd
commit e5f051a
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"}` | ||
``` |