1
0
mirror of https://github.com/pavlobu/deskreen.git synced 2025-05-18 00:10:12 -07:00
deskreen/app/api/urlGenerator.ts
2021-01-17 23:45:59 +02:00

16 lines
288 B
TypeScript

/* istanbul ignore file */
import config from './config';
export default (resourceName = '') => {
const { port, protocol, host } = config;
const resourcePath = resourceName;
if (!host) {
return `/localhost`;
}
return `${protocol}://${host}:${port}/${resourcePath}`;
};