From a3cd4f8168ea6f7a6d997bb246b4614bfb23384d Mon Sep 17 00:00:00 2001 From: Devoalda Date: Wed, 1 Nov 2023 07:28:34 +0800 Subject: [PATCH] feature(Frontend url update): Updated frontend to use env for apiurl --- safeshare/safeshare-frontend/src/pages/downloadFile.js | 5 ++--- safeshare/safeshare-frontend/src/pages/shareFile.js | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/safeshare/safeshare-frontend/src/pages/downloadFile.js b/safeshare/safeshare-frontend/src/pages/downloadFile.js index 6f6731c..641730f 100644 --- a/safeshare/safeshare-frontend/src/pages/downloadFile.js +++ b/safeshare/safeshare-frontend/src/pages/downloadFile.js @@ -20,10 +20,9 @@ function DownloadFile() { const [errorMsg, setErrorcode] = useState(''); let subtitle; const [modalIsOpen, setIsOpen] = React.useState(false); - const apiHost = process.env.REACT_APP_API_HOST || 'localhost'; - const apiPort = process.env.REACT_APP_API_PORT || '8000'; + const apiUrl = process.env.REACT_APP_API_HOST || 'localhost:8000'; - const apiUrl = `${apiHost}:${apiPort}`; + console.log(apiUrl); function openModal() { setIsOpen(true); diff --git a/safeshare/safeshare-frontend/src/pages/shareFile.js b/safeshare/safeshare-frontend/src/pages/shareFile.js index d7006d0..05806d0 100644 --- a/safeshare/safeshare-frontend/src/pages/shareFile.js +++ b/safeshare/safeshare-frontend/src/pages/shareFile.js @@ -24,6 +24,7 @@ function ShareFile() { let subtitle; const [modalIsOpen, setIsOpen] = React.useState(false); const apiUrl = process.env.REACT_APP_API_HOST || 'localhost:8000'; + console.log(apiUrl); // const apiPort = process.env.REACT_APP_API_PORT || '8000'; // // const apiUrl = `${apiHost}:${apiPort}`;