Skip to content

Commit d95b723

Browse files
Update Layout.js
1 parent 75ebe04 commit d95b723

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

  • DocuSign.Workspaces/DocuSign.Workspaces/ClientApp/src/components

DocuSign.Workspaces/DocuSign.Workspaces/ClientApp/src/components/Layout.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,17 @@ import { useTranslation } from 'react-i18next';
44
import LoginModal from '../loginModal/LoginModal';
55
import { ReactComponent as ChevronRightIcon } from '../assets/icons/chevron-right.svg';
66

7-
export const API_BASE = 'https://localhost:5001';
7+
const resolveApiBase = () => {
8+
if (process.env.REACT_APP_API_BASE) {
9+
return process.env.REACT_APP_API_BASE;
10+
}
11+
if (typeof window !== 'undefined') {
12+
return window.location.origin;
13+
}
14+
return '';
15+
};
16+
17+
export const API_BASE = resolveApiBase();
818

919
export default function Layout() {
1020
const { t } = useTranslation();

0 commit comments

Comments
 (0)