From 8c472ce3091ac375c995ce0e32d7aa1b806546d2 Mon Sep 17 00:00:00 2001 From: Vasilii Mikhailovskii Date: Wed, 27 Nov 2024 09:23:22 +0200 Subject: [PATCH] add VITE_READ_BASE_URL --- apps/frontend/.env.production | 3 ++- apps/frontend/src/api/qrCode.ts | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/frontend/.env.production b/apps/frontend/.env.production index 8dd3fa6..8eefb18 100644 --- a/apps/frontend/.env.production +++ b/apps/frontend/.env.production @@ -1 +1,2 @@ -VITE_API_URL=https://hereconnect.condev.ru/api \ No newline at end of file +VITE_API_URL=https://hereconnect.condev.ru/api +VITE_READ_BASE_URL=https://r.condev.ru \ No newline at end of file diff --git a/apps/frontend/src/api/qrCode.ts b/apps/frontend/src/api/qrCode.ts index de9f77e..85b4611 100644 --- a/apps/frontend/src/api/qrCode.ts +++ b/apps/frontend/src/api/qrCode.ts @@ -13,7 +13,10 @@ export const createQrCodeDocument = async ( >, ) => { const uri = Math.abs(Date.now() - EPOHE).toString(36) - const url = new URL(`/read/${uri}`, location.origin).toString() + const url = new URL( + `${import.meta.env.VITE_READ_BASE_URL || '/read'}/${uri}`, + location.origin, + ).toString() const qrCodeDoc: QRCodeDocument = { _id: `qr_code:${uri}`,