diff --git a/nuxt.config.ts b/nuxt.config.ts index 91fc366..5892e9a 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -21,10 +21,9 @@ export default defineNuxtConfig({ }, runtimeConfig: { - // Set in .env - rpcUrl: '', + rpcUrl: process.env.NUXT_RPC_URL || '', public: { - nimiqNetwork: '', + nimiqNetwork: process.env.NUXT_PUBLIC_NIMIQ_NETWORK || '', } }, @@ -48,6 +47,7 @@ export default defineNuxtConfig({ }, nitro: { + minify: false, esbuild: { options: { target: 'esnext', diff --git a/package.json b/package.json index 8a6dc6a..d5d1d6a 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "dependencies": { "@nimiq/core": "2.0.0-next.23.0", "@nuxt/eslint": "^0.5.0", - "@nuxthub/core": "^0.7.1", + "@nuxthub/core": "^0.7.2", "@unovis/ts": "^1.4.4", "@unovis/vue": "^1.4.4", "@vueuse/core": "^10.11.1", diff --git a/server/utils/client.ts b/server/utils/client.ts index 91d7562..92d90cb 100644 --- a/server/utils/client.ts +++ b/server/utils/client.ts @@ -16,8 +16,11 @@ export async function getClient() { // TODO Use this rpc client app-wide export async function getRpcClient() { + const url = useRuntimeConfig().rpcUrl + if (!url) + throw new Error('Missing RPC URL in runtime config') if (!rpcClient) { - rpcClient = new NimiqRPCClient(new URL(useRuntimeConfig().rpcUrl)) + rpcClient = new NimiqRPCClient(new URL(url)) } return rpcClient } \ No newline at end of file