Skip to content

Commit

Permalink
Make it a constant
Browse files Browse the repository at this point in the history
  • Loading branch information
sourishkrout committed Jul 24, 2023
1 parent ba96085 commit 40b4a28
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/utils/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const DEFAULT_TLS_DIR = path.join(os.tmpdir(), 'runme', uuidv4(), 'tls')
const DEFAULT_WORKSPACE_FILE_ORDER = ['.env.local', '.env']
const DEFAULT_RUNME_APP_API_URL = 'https://api.runme.dev'
const DEFAULT_RUNME_BASE_DOMAIN = 'runme.dev'
const APP_LOOPBACKS = ['127.0.0.1', 'localhost']
const APP_LOOPBACK_MAPPING = new Map<string, string>([
['api.', ':4000'],
['app.', ':4001'],
Expand Down Expand Up @@ -260,9 +261,7 @@ const getCLIUseIntegratedRunme = (): boolean => {

const getRunmeAppUrl = (subdomain: string[]): string => {
const base = getRunmeBaseDomain()
const isLoopback = ['127.0.0.1', 'localhost']
.map((host) => base.includes(host))
.reduce((p, c) => p || c)
const isLoopback = APP_LOOPBACKS.map((host) => base.includes(host)).reduce((p, c) => p || c)
const scheme = isLoopback ? 'http' : 'https'

let sub = subdomain.join('.')
Expand Down

0 comments on commit 40b4a28

Please sign in to comment.