chore: update

This commit is contained in:
Anthony Fu 2022-11-15 23:54:58 +08:00
parent 7ab17001f0
commit 39249e378f
2 changed files with 5 additions and 1 deletions

View file

@ -24,4 +24,7 @@ export default defineNuxtConfig({
'postcss-nested': {}, 'postcss-nested': {},
}, },
}, },
runtimeConfig: {
registedAppsUrl: process.env.APPS_JSON_URL || 'http://localhost:3000/registered-apps.json',
},
}) })

View file

@ -3,7 +3,8 @@ import type { AppInfo } from '~/types'
export const registeredApps: Record<string, AppInfo> = {} export const registeredApps: Record<string, AppInfo> = {}
const promise = $fetch(process.env.APPS_JSON_URL || 'http://localhost:3000/registered-apps.json') const runtimeConfig = useRuntimeConfig()
const promise = $fetch(runtimeConfig.registedAppsUrl)
.then(r => Object.assign(registeredApps, r)) .then(r => Object.assign(registeredApps, r))
.catch((e) => { .catch((e) => {
if (process.dev) if (process.dev)