pull/5/head
Anthony Fu 2022-11-15 23:54:58 +08:00
rodzic 7ab17001f0
commit 39249e378f
2 zmienionych plików z 5 dodań i 1 usunięć

Wyświetl plik

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

Wyświetl plik

@ -3,7 +3,8 @@ import type { AppInfo } from '~/types'
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))
.catch((e) => {
if (process.dev)