|
@ -14,13 +14,16 @@ args.option(['p', 'port'], '启动端口'); |
|
|
args.option(['u', 'api-url'], 'webapi的URL'); |
|
|
args.option(['u', 'api-url'], 'webapi的URL'); |
|
|
args.option('apiPomsUrl', 'webapi的URL 外网可访问'); |
|
|
args.option('apiPomsUrl', 'webapi的URL 外网可访问'); |
|
|
args.option('apiAnxinyunUrl', '安心云 api'); |
|
|
args.option('apiAnxinyunUrl', '安心云 api'); |
|
|
|
|
|
args.option('apiEmisUrl', '企业管理 api'); |
|
|
|
|
|
|
|
|
const flags = args.parse(process.argv); |
|
|
const flags = args.parse(process.argv); |
|
|
|
|
|
|
|
|
const API_URL = process.env.API_URL || flags.apiUrl; |
|
|
const API_URL = process.env.API_URL || flags.apiUrl; |
|
|
const API_POMS_URL = process.env.API_POMS_URL || flags.apiPomsUrl; |
|
|
const API_POMS_URL = process.env.API_POMS_URL || flags.apiPomsUrl; |
|
|
|
|
|
const API_EMIS_URL = process.env.API_EMIS_URL || flags.apiEmisUrl; |
|
|
const API_ANXINYUN_URL = process.env.API_ANXINYUN_URL || flags.apiAnxinyunUrl; |
|
|
const API_ANXINYUN_URL = process.env.API_ANXINYUN_URL || flags.apiAnxinyunUrl; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!API_URL || !API_ANXINYUN_URL) { |
|
|
if (!API_URL || !API_ANXINYUN_URL) { |
|
|
console.log('缺少启动参数,异常退出'); |
|
|
console.log('缺少启动参数,异常退出'); |
|
|
args.showHelp(); |
|
|
args.showHelp(); |
|
@ -42,6 +45,12 @@ const product = { |
|
|
host: API_ANXINYUN_URL, |
|
|
host: API_ANXINYUN_URL, |
|
|
match: /^\/_axy\//, |
|
|
match: /^\/_axy\//, |
|
|
} |
|
|
} |
|
|
|
|
|
}, { |
|
|
|
|
|
entry: require('./middlewares/proxy').entry, |
|
|
|
|
|
opts: { |
|
|
|
|
|
host: API_EMIS_URL, |
|
|
|
|
|
match: /^\/_emis\//, |
|
|
|
|
|
} |
|
|
}, { |
|
|
}, { |
|
|
entry: require('./routes').entry, |
|
|
entry: require('./routes').entry, |
|
|
opts: { |
|
|
opts: { |
|
|