Browse Source

水务、安监地址可配置

master
liujiangyong 1 year ago
parent
commit
3f3ffcac89
  1. 4
      api/.vscode/launch.json
  2. 11
      api/config.js
  3. 2
      api/package.json

4
api/.vscode/launch.json

@ -16,10 +16,12 @@
"-p 4400",
//
"-g postgres://FashionAdmin:123456@10.8.30.39:5432/GovernmentDataResourceCenter",
// "-g postgres://FashionAdmin:123456@10.8.30.156:5432/gdrcenter",
// "-g postgres://FashionAdmin:123456@10.8.30.156:5432/gdrcenter",
"-b http://10.8.30.161:31420",
"-s http://10.8.30.161:32258",
"-d postgres/example/10.8.30.160/30432",
"-w https://waterconservancy.anxinyun.cn",
"-a https://smartworksafety.anxinyun.cn",
]
},
{

11
api/config.js

@ -13,6 +13,8 @@ args.option(['g', 'pg'], 'postgre 服务 URL');
args.option(['b', 'backups'], '后端数据库备份恢复接口地址');
args.option(['s', 'kubesphere'], 'kubesphere地址');
args.option(['d', 'dbconfig'], '后台同步数据库host示例:postgres/example/10.8.30.160/30432 格式:用户名/密码/host/port');
args.option(['w', 'water'], '水环境地址');
args.option(['a', 'worksafety'], '安监地址');
const flags = args.parse(process.argv);
@ -28,7 +30,10 @@ const BACKUPS_URL = process.env.BACKUPS_URL || flags.backups;
const KUBESPHERE_URL = process.env.KUBESPHERE_URL || flags.kubesphere;
const DATABASE_CONFIG = process.env.DATABASE_HOST || flags.dbconfig;//同步数据库配置
if (!DB || !BACKUPS_URL || !KUBESPHERE_URL || !DATABASE_CONFIG) {
const WATER_URL = process.env.WATER_URL || flags.water;
const WORKSAFETY_URL = process.env.WORKSAFETY_URL || flags.worksafety;
if (!DB || !BACKUPS_URL || !KUBESPHERE_URL || !DATABASE_CONFIG || !WATER_URL || !WORKSAFETY_URL) {
console.log('缺少启动参数,异常退出');
args.showHelp();
process.exit(-1);
@ -81,13 +86,13 @@ const product = {
}, {
entry: require('./app/lib/middlewares/proxy').entry,
opts: {
host: 'https://waterconservancy.anxinyun.cn',
host: WATER_URL,
match: /\/_water\//,
}
}, {
entry: require('./app/lib/middlewares/proxy').entry,
opts: {
host: 'https://smartworksafety.anxinyun.cn',
host: WORKSAFETY_URL,
match: /\/_worksafety\//,
}
}

2
api/package.json

@ -5,7 +5,7 @@
"main": "server.js",
"scripts": {
"test": "set DEBUG=true&&\"node_modules/.bin/mocha\" --harmony --reporter spec app/test/*.test.js",
"start": "set NODE_ENV=development&&node server -p 4400 -g postgres://postgres:123@10.8.30.32:5432/xxx -f http://localhost:4400",
"start": "set NODE_ENV=development&&node server -p 4400 -g postgres://postgres:123@10.8.30.32:5432/xxx -f http://localhost:4400 -w https://waterconservancy.anxinyun.cn -a https://smartworksafety.anxinyun.cn",
"start:linux": "export NODE_ENV=development&&node server -p 4400 -g postgres://FashionAdmin:123456@10.8.30.39:5432/xxx",
"automate": "sequelize-automate -c sequelize-automate.config.js"
},

Loading…
Cancel
Save