From 39249e378fa4ec036093954ebdf4c3b9d5e1299f Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Tue, 15 Nov 2022 23:54:58 +0800 Subject: [PATCH] chore: update --- nuxt.config.ts | 3 +++ server/shared.ts | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/nuxt.config.ts b/nuxt.config.ts index b1ec1013..0247576d 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -24,4 +24,7 @@ export default defineNuxtConfig({ 'postcss-nested': {}, }, }, + runtimeConfig: { + registedAppsUrl: process.env.APPS_JSON_URL || 'http://localhost:3000/registered-apps.json', + }, }) diff --git a/server/shared.ts b/server/shared.ts index b848cbb1..74f5404a 100644 --- a/server/shared.ts +++ b/server/shared.ts @@ -3,7 +3,8 @@ import type { AppInfo } from '~/types' export const registeredApps: Record = {} -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)