feature(Frontend url update): Updated frontend to use env for apiurl

This commit is contained in:
Devoalda 2023-11-01 07:28:34 +08:00
parent 4ef5bfc976
commit a3cd4f8168
2 changed files with 3 additions and 3 deletions

View File

@ -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);

View File

@ -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}`;