Skip to content

Commit 31d0b3f

Browse files
authored
Merge pull request #43 from ph0bos/version-override
added functionality to override version number in info endpoint
2 parents 633c5aa + 1299a3e commit 31d0b3f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ In the above example the application would be accessible at the following addres
9191

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

94+
If you would like to override the version which is exposed in the /info endpoint, just set the VERSION node env variable.
95+
96+
```sh
97+
VERSION=1.0.1 node index.js
98+
```
99+
94100
## API
95101

96102
```javascript

controllers/info.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module.exports = function (router) {
1515
res.json({
1616
"build": {
1717
"description": packageInfo.description,
18-
"version": packageInfo.version,
18+
"version": process.env.VERSION || packageInfo.version,
1919
"name": packageInfo.name
2020
}
2121
});

0 commit comments

Comments
 (0)