This repository has been archived on 2025-05-09. You can view files and clone it, but cannot push or open issues or pull requests.

12 lines
296 B
JavaScript

import { SERVER_PORT } from 'core/constants/urls';
export const API_HOSTNAME = window.location.hostname;
export const getServerUrl = url =>
String.prototype.concat(
(process.env.NODE_ENV === 'development' &&
`http://${API_HOSTNAME}:${SERVER_PORT}`) ||
'',
url || '',
);