mirror of
https://github.com/darkwire/darkwire.io.git
synced 2025-07-18 10:49:02 +00:00
15 lines
293 B
JavaScript
15 lines
293 B
JavaScript
/* istanbul ignore file */
|
|
import config from './config';
|
|
|
|
export default (resourceName = '') => {
|
|
const { port, protocol, host } = config;
|
|
|
|
const resourcePath = resourceName;
|
|
|
|
if (!host) {
|
|
return `/${resourcePath}`;
|
|
}
|
|
|
|
return `${protocol}://${host}:${port}/${resourcePath}`;
|
|
};
|