feat(HMS-1909): enable a custom host in LOCAL_API env var

This commit is contained in:
Amir Fefer 2023-08-13 20:44:12 +03:00 committed by Lucas Garfield
parent d8e47de0c5
commit 9fd260cfea

View file

@ -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}`,
},
};
}, {}),