Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Bug 525584 - Update package.json and version endpoint
  • Loading branch information
mrennie committed Oct 4, 2017
1 parent a6a79e7 commit 2811964
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion modules/orionode/lib/version.js
Expand Up @@ -11,7 +11,8 @@
/*eslint-env node */
var express = require('express'),
api = require('./api'),
responseTime = require('response-time');
responseTime = require('response-time'),
pjson = require('../package.json');

module.exports = {};

Expand All @@ -25,6 +26,10 @@ module.exports.router = function(options) {
.use(responseTime({digits: 2, header: "X-Version-Response-Time", suffix: true}))
.get('*', /* @callback */ function (req, res) {
var buildID = configParams["orion.buildId"] || BUILD_ID;
if(buildID === "unknown" && pjson && typeof pjson.version === 'string') {
//for the NPM case we want to return the version published to NPM (from the package.json)
buildID = pjson.version;
}
return api.writeResponse(200, res, null, {
build: buildID
});
Expand Down
4 changes: 2 additions & 2 deletions modules/orionode/package.json
@@ -1,6 +1,6 @@
{
"name": "orion",
"version": "15.0.0",
"version": "16.0.0",
"description": "An Eclipse Orion server written in Node.js.",
"homepage": "http://eclipse.org/orion/",
"bugs": "https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Orion&component=Node",
Expand Down Expand Up @@ -141,7 +141,7 @@
},
"repository": {
"type": "git",
"url": "git://git.eclipse.org/gitroot/orion/org.eclipse.orion.client.git"
"url": "https://github.com/eclipse/orion.client"
},
"keywords": [
"orion",
Expand Down

0 comments on commit 2811964

Please sign in to comment.