qb-admin-fe/src/api/utils.js
2019-03-23 14:09:48 +00:00

5 lines
245 B
JavaScript

const isLocalhost = (instanceName) =>
instanceName.startsWith('localhost:') || instanceName.startsWith('127.0.0.1:')
export const baseName = (instanceName) =>
isLocalhost(instanceName) ? `http://${instanceName}` : `https://${instanceName}`