From 708ea1ed25ccef7b90703321ac99213aeb6be1ad Mon Sep 17 00:00:00 2001 From: Josua Frank Date: Tue, 7 May 2024 12:50:25 +0200 Subject: [PATCH] fix issues with runtime config --- .env.example | 2 ++ components/tools/OrderModal.vue | 2 +- nuxt.config.ts | 5 ++--- 3 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..5d0a53e --- /dev/null +++ b/.env.example @@ -0,0 +1,2 @@ +NUXT_PUBLIC_PIXELHOBBY_TILE_ID=35007450218648 +NUXT_PUBLIC_API_URL=https://example.com/api/v1/progress \ No newline at end of file diff --git a/components/tools/OrderModal.vue b/components/tools/OrderModal.vue index d6b9214..499e3a0 100644 --- a/components/tools/OrderModal.vue +++ b/components/tools/OrderModal.vue @@ -112,7 +112,7 @@ function order() { }; }); const tile = { - id: runtimeConfig.public.pixelhobbTileId, + id: runtimeConfig.public.pixelhobbyTileId, quantity: props.tiles.length, }; body.push(tile); diff --git a/nuxt.config.ts b/nuxt.config.ts index 9e45e82..f5a0bdb 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -4,9 +4,8 @@ export default defineNuxtConfig({ css: ["bootstrap/dist/css/bootstrap.min.css", "/assets/main.css"], runtimeConfig: { public: { - apiUrl: process.env.PIXINA_API_URL, - pixelhobbTileId: - parseInt(process.env.PIXINA_PIXELHOBBY_TILE_ID ?? "") || 35007450218648, + apiUrl: "", // can be overwritten by NUXT_PUBLIC_API_URL environment variable + pixelhobbyTileId: 35007450218648, // can be overwritten by NUXT_PUBLIC_PIXELHOBBY_TILE_ID environment variable }, }, modules: [