File size: 557 Bytes
e079a73
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import {getConfigValues} from "../runtime/bootstrap"

/**

 * Explicit Metro / laptop host override used by stale-URL rewrite and launch

 * failover. One source of truth so AppRegistry and decideDevLaunchRoute stay aligned.

 */
export function configuredDevHost(): string | undefined {
  const explicit = process.env.EXPO_PUBLIC_LOCAL_MINIAPP_HOST
  if (explicit) {
    try {
      return new URL(explicit).hostname
    } catch {
      if (/^[\w.-]+$/.test(explicit)) return explicit
    }
  }
  return getConfigValues().devServerHost?.()
}