Browse Source

moment require

release_0.0.2
巴林闲侠 2 years ago
parent
commit
e7b2ed2223
  1. 20
      api/app/lib/service/clickHouseClient.js
  2. 5
      api/config.js

20
api/app/lib/service/clickHouseClient.js

@ -0,0 +1,20 @@
'use strict';
function factory (app, opts) {
if (opts.clickHouse) {
try {
for (let r of opts.clickHouse) {
if (r.name && r.root) {
app.fs[r.name] = new paasRequest(r.root, { ...(r.params || {}) }, { dataWord: r.dataWord || 'body' })
} else {
throw 'opts.pssaRequest 参数错误!'
}
}
} catch (error) {
console.error(error)
process.exit(-1);
}
}
}
module.exports = factory;

5
api/config.js

@ -30,6 +30,11 @@ args.option('qnsk', 'qiniuSecretKey');
args.option('qnbkt', 'qiniuBucket'); args.option('qnbkt', 'qiniuBucket');
args.option('qndmn', 'qiniuDomain'); args.option('qndmn', 'qiniuDomain');
// clickHouse
args.option('clickHouseUrl', 'clickHouse Url');
args.option('clickHousePort', 'clickHouse Port');
args.option('clickHouseAnxincloudDB', 'clickHouse 安心云数据库名称');
const flags = args.parse(process.argv); const flags = args.parse(process.argv);
const POMS_DB = process.env.POMS_DB || flags.pg; const POMS_DB = process.env.POMS_DB || flags.pg;

Loading…
Cancel
Save