zhike-consul
Advanced tools
Comparing version 1.0.7 to 1.0.8
31
index.js
@@ -46,3 +46,4 @@ 'use strict'; | ||
port: this.port, | ||
promisify: true | ||
promisify: true, | ||
timeout: 1000 | ||
}); | ||
@@ -62,2 +63,30 @@ | ||
env = env || 'development'; | ||
// status check | ||
try { | ||
yield this.consul.health.checks('test'); | ||
} catch(err) { | ||
console.log(err.stack); | ||
let privateKey; | ||
for (let i = 0; i < this.keys.length; i++) { | ||
if (this.keys[i].indexOf('Private') !== -1) { | ||
privateKey = this.keys[i]; | ||
this.ref.CFG[privateKey] = {}; | ||
break; | ||
} | ||
} | ||
this.ref.config = require(process.cwd() + '/config.local.js'); | ||
for (let key in this.ref.config) { | ||
if (this.keys.indexOf(key) !== -1) { | ||
this.ref.CFG[key] = this.ref.config[key]; | ||
} else { | ||
this.ref.CFG[privateKey][key] = this.ref.config[key]; | ||
} | ||
} | ||
return { | ||
CFG: this.ref.CFG, | ||
config: this.ref.config | ||
} | ||
} | ||
for (let i = 0; i < this.keys.length; i++) { | ||
@@ -64,0 +93,0 @@ let key = this.keys[i]; |
{ | ||
"name": "zhike-consul", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "a simple consul client", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
7221
145
2