Skip to content

Commit

Permalink
Merge pull request #43 from ph0bos/version-override
Browse files Browse the repository at this point in the history
added functionality to override version number in info endpoint
  • Loading branch information
ph0bos authored Jul 6, 2018
2 parents 633c5aa + 1299a3e commit 31d0b3f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ In the above example the application would be accessible at the following addres

Note: the `registrationNetworkInterfacePriority` property allows the selection of the network interface when dynamically registering a service with ZooKeeper.

If you would like to override the version which is exposed in the /info endpoint, just set the VERSION node env variable.

```sh
VERSION=1.0.1 node index.js
```

## API

```javascript
Expand Down
2 changes: 1 addition & 1 deletion controllers/info.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = function (router) {
res.json({
"build": {
"description": packageInfo.description,
"version": packageInfo.version,
"version": process.env.VERSION || packageInfo.version,
"name": packageInfo.name
}
});
Expand Down

0 comments on commit 31d0b3f

Please sign in to comment.