|
|
@ -15,20 +15,16 @@ dev && console.log('\x1B[33m%s\x1b[0m', '请遵循并及时更新 readme.md, |
|
|
|
// // 启动参数
|
|
|
|
args.option(['p', 'port'], '启动端口'); |
|
|
|
args.option(['u', 'api-url'], 'webapi的URL'); |
|
|
|
args.option('apiAnxinyunUrl', "安心云api"); |
|
|
|
args.option('axyProject', '安心云泵站项目信息'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const flags = args.parse(process.argv); |
|
|
|
|
|
|
|
const FS_UNIAPP_API = process.env.FS_UNIAPP_API || flags.apiUrl; |
|
|
|
const API_ANXINYUN_URL = process.env.API_ANXINYUN_URL || flags.apiAnxinyunUrl |
|
|
|
const AXY_BZ_PROJECT = process.env.AXY_BZ_PROJECT || flags.axyProject |
|
|
|
|
|
|
|
|
|
|
|
if ( |
|
|
|
!FS_UNIAPP_API |
|
|
|
|| !API_ANXINYUN_URL |
|
|
|
) { |
|
|
|
console.log('缺少启动参数,异常退出'); |
|
|
|
args.showHelp(); |
|
|
@ -47,8 +43,7 @@ const product = { |
|
|
|
}, { |
|
|
|
entry: require('./middlewares/proxy').entry, |
|
|
|
opts: { |
|
|
|
host: API_ANXINYUN_URL, |
|
|
|
match: /^\/_axy\//, |
|
|
|
|
|
|
|
} |
|
|
|
}, { |
|
|
|
entry: require('./middlewares/attachment').entry, |
|
|
@ -59,8 +54,7 @@ const product = { |
|
|
|
}, { |
|
|
|
entry: require('./routes').entry, |
|
|
|
opts: { |
|
|
|
axyApi: API_ANXINYUN_URL, |
|
|
|
axyProject: AXY_BZ_PROJECT |
|
|
|
|
|
|
|
} |
|
|
|
}, { |
|
|
|
entry: require('./client').entry,// 静态信息
|
|
|
|