|
@ -12,10 +12,12 @@ dev && console.log('\x1B[33m%s\x1b[0m', '请遵循并及时更新 readme.md, |
|
|
// // 启动参数
|
|
|
// // 启动参数
|
|
|
args.option(['p', 'port'], '启动端口'); |
|
|
args.option(['p', 'port'], '启动端口'); |
|
|
args.option(['u', 'api-url'], 'webapi的URL'); |
|
|
args.option(['u', 'api-url'], 'webapi的URL'); |
|
|
|
|
|
args.option('apiAuthUrl', 'apiAuthUrl'); |
|
|
|
|
|
|
|
|
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_AUTH_URL = process.env.API_AUTH_URL || flags.apiAuthUrl; |
|
|
|
|
|
|
|
|
if (!API_URL) { |
|
|
if (!API_URL) { |
|
|
console.log('缺少启动参数,异常退出'); |
|
|
console.log('缺少启动参数,异常退出'); |
|
@ -35,7 +37,7 @@ const product = { |
|
|
}, { |
|
|
}, { |
|
|
entry: require('./middlewares/proxy').entry, |
|
|
entry: require('./middlewares/proxy').entry, |
|
|
opts: { |
|
|
opts: { |
|
|
host: 'http://localhost:4200', |
|
|
host: API_AUTH_URL, |
|
|
match: /^\/_auth\//, |
|
|
match: /^\/_auth\//, |
|
|
} |
|
|
} |
|
|
}, { |
|
|
}, { |
|
|