feat(HMS-1909): enable a custom host in LOCAL_API env var
This commit is contained in:
parent
d8e47de0c5
commit
9fd260cfea
1 changed files with 4 additions and 3 deletions
|
|
@ -24,12 +24,13 @@ const webpackProxy = {
|
|||
...(process.env.LOCAL_API && {
|
||||
...(process.env.LOCAL_API.split(',') || []).reduce((acc, curr) => {
|
||||
const [appName, appConfig] = (curr || '').split(':');
|
||||
const [appPort = 8003, protocol = 'http'] = appConfig.split('~');
|
||||
const [appPort = 8003, protocol = 'http', host = 'localhost'] =
|
||||
appConfig.split('~');
|
||||
return {
|
||||
...acc,
|
||||
[`/apps/${appName}`]: { host: `${protocol}://localhost:${appPort}` },
|
||||
[`/apps/${appName}`]: { host: `${protocol}://${host}:${appPort}` },
|
||||
[`/beta/apps/${appName}`]: {
|
||||
host: `${protocol}://localhost:${appPort}`,
|
||||
host: `${protocol}://${host}:${appPort}`,
|
||||
},
|
||||
};
|
||||
}, {}),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue