import { Config } from '../../../helper'; /** * Read configs from meta tags if available, otherwise use the process.env injected from build. * * @author Robert Long * @param (Object) Provides applcation configs. */ const configs = {}; const get = (configs, key, defaultValue) => { // @ts-ignore if (!process.browser) { return; } const el = document.querySelector(`meta[name='env:${key.toLowerCase()}']`); if (el) { configs[key] = el.getAttribute("content"); } else { configs[key] = defaultValue; } }; get(configs, "GA_TRACKING_ID", process.env.GA_TRACKING_ID); get(configs, "SENTRY_DSN", process.env.SENTRY_DSN); (configs as any).name = (): string => "Scene Editor"; (configs as any).longName = (): string => "Scene Editor"; (configs as any).SERVER_URL = process.env.NODE_ENV === 'production' ? Config.publicRuntimeConfig.apiServer : 'https://127.0.0.1:3030'; (configs as any).APP_URL = process.env.NODE_ENV === 'production' ? Config.publicRuntimeConfig.appServer : 'https://127.0.0.1:3000'; (configs as any).FEATHERS_STORE_KEY = process.env.NODE_ENV === 'production' ? Config.publicRuntimeConfig.feathersStoreKey : 'TheOverlay-Auth-Store'; export default configs;