UNPKG

react-cosmos

Version:

Sandbox for developing and testing UI components in isolation

16 lines (15 loc) 531 B
import { getServerHost } from './serverAddress.js'; export function getPlaygroundUrls(config) { const protocol = config.https ? 'https' : 'http'; if (config.host) { return [`${protocol}://${config.host}:${config.port}`]; } return [ `${protocol}://localhost:${config.port}`, `${protocol}://${getServerHost(config)}:${config.port}`, ]; } export function logPlaygroundUrls(config) { const urls = getPlaygroundUrls(config); console.log(`[Cosmos] See you at ${urls.join(' or ')}`); }