Browse Source

Fixed version bug

pull/48/head
Philip Ebels 6 years ago
parent
commit
95b3439fab
  1. 2
      index.js
  2. 3
      lib/xapi.js
  3. 19
      package-lock.json
  4. 3
      package.json

2
index.js

@ -11,12 +11,14 @@ const Xapi = require('./lib/xapi.js');
const cmdargs = require('./lib/util/cmd.helper.js'); const cmdargs = require('./lib/util/cmd.helper.js');
const cluster = require('cluster'); const cluster = require('cluster');
const numCPUs = require('os').cpus().length; const numCPUs = require('os').cpus().length;
const { version } = require('./package.json');
function startXmysql(sqlConfig) { function startXmysql(sqlConfig) {
/**************** START : setup express ****************/ /**************** START : setup express ****************/
let app = express(); let app = express();
app.set('version', version);
app.use(morgan('tiny')); app.use(morgan('tiny'));
app.use(cors()); app.use(cors());
app.use(bodyParser.json()); app.use(bodyParser.json());

3
lib/xapi.js

@ -4,7 +4,6 @@ var Xsql = require('./xsql.js');
var Xctrl = require('./xctrl.js'); var Xctrl = require('./xctrl.js');
var multer = require('multer'); var multer = require('multer');
const path = require('path'); const path = require('path');
const pkginfo = require('pkginfo')(module);
const v8 = require('v8'), const v8 = require('v8'),
os = require('os'); os = require('os');
@ -444,7 +443,7 @@ class Xapi {
let version = {}; let version = {};
version['Xmysql'] = pkginfo.version; version['Xmysql'] = this.app.get('version');
version['mysql'] = await this.getMysqlHealth(); version['mysql'] = await this.getMysqlHealth();
version['node'] = process.versions.node; version['node'] = process.versions.node;
res.json(version); res.json(version);

19
package-lock.json generated

@ -1,6 +1,6 @@
{ {
"name": "xmysql", "name": "xmysql",
"version": "0.4.8", "version": "0.4.9",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@ -621,9 +621,9 @@
} }
}, },
"nan": { "nan": {
"version": "2.7.0", "version": "2.11.0",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.7.0.tgz", "resolved": "https://registry.npmjs.org/nan/-/nan-2.11.0.tgz",
"integrity": "sha1-2Vv3IeyHfgjbJ27T/G63j5CDrUY=", "integrity": "sha512-F4miItu2rGnV2ySkXOQoA8FKz/SR2Q2sWP0sbTxNxz/tuokeC8WxOhPMcwi0qIyGtVn/rrSeLbvVkznqCdwYnw==",
"dev": true "dev": true
}, },
"negotiator": { "negotiator": {
@ -674,11 +674,6 @@
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
"integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w="
}, },
"pkginfo": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/pkginfo/-/pkginfo-0.4.1.tgz",
"integrity": "sha1-tUGO8EOd5UJfxJlQQtztFPsqhP8="
},
"process-nextick-args": { "process-nextick-args": {
"version": "1.0.7", "version": "1.0.7",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz",
@ -824,9 +819,9 @@
"dev": true "dev": true
}, },
"sleep": { "sleep": {
"version": "5.1.1", "version": "5.2.3",
"resolved": "https://registry.npmjs.org/sleep/-/sleep-5.1.1.tgz", "resolved": "https://registry.npmjs.org/sleep/-/sleep-5.2.3.tgz",
"integrity": "sha1-h4+h1E0I7rDyb7IBjvhinrGjq5Q=", "integrity": "sha512-vC05N1XqgIiPIj6tEq7wt0R32aTycJv4Ymo/jwSEp2PkeU1GCJ1tkl+RdYZEo7Gjebq8QQuhFuEe7vsyVGlFRA==",
"dev": true, "dev": true,
"requires": { "requires": {
"nan": ">=2.5.1" "nan": ">=2.5.1"

3
package.json

@ -33,8 +33,7 @@
"express": "^4.16.1", "express": "^4.16.1",
"morgan": "^1.9.0", "morgan": "^1.9.0",
"multer": "^1.3.0", "multer": "^1.3.0",
"mysql": "^2.15.0", "mysql": "^2.15.0"
"pkginfo": "^0.4.1"
}, },
"devDependencies": { "devDependencies": {
"mocha": "^5.2.0", "mocha": "^5.2.0",

Loading…
Cancel
Save