From 80ee6ddebd9898f7e9db18363f4adabef7c54f9b Mon Sep 17 00:00:00 2001 From: Marco Quintana Date: Thu, 14 Mar 2024 03:37:15 +0100 Subject: [PATCH] Trying to update the release github action v1.0.6 --- webapp/.env | 3 ++- webapp/Dockerfile | 3 +++ webapp/src/components/FirstGame.js | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/webapp/.env b/webapp/.env index c810bde7..b816b0a1 100644 --- a/webapp/.env +++ b/webapp/.env @@ -1 +1,2 @@ -REACT_APP_API_ENDPOINT=http://localhost:8000 \ No newline at end of file +REACT_APP_API_ENDPOINT=http://localhost:8000 +CONNECTION_WITH_QUESTIONS_API=http://localhost:8007 \ No newline at end of file diff --git a/webapp/Dockerfile b/webapp/Dockerfile index 3cbad8b7..c23d62fa 100644 --- a/webapp/Dockerfile +++ b/webapp/Dockerfile @@ -9,6 +9,9 @@ RUN npm install ARG API_URI="http://localhost:8000" ENV REACT_APP_API_ENDPOINT=$API_URI +ARG QUESTIONS_API="http://localhost:8007" +ENV CONNECTION_WITH_QUESTIONS_API=$QUESTIONS_API + #Create an optimized version of the webapp RUN npm run build RUN npm install serve diff --git a/webapp/src/components/FirstGame.js b/webapp/src/components/FirstGame.js index 6778016b..5b9dc84d 100644 --- a/webapp/src/components/FirstGame.js +++ b/webapp/src/components/FirstGame.js @@ -6,7 +6,7 @@ import axios from 'axios'; import { useNavigate, useLocation } from 'react-router-dom'; -const apiEndpoint = 'http://localhost:8007'; +const apiEndpoint = process.env.CONNECTION_WITH_QUESTIONS_API || 'http://localhost:8007'; const Quiz = () => { const navigation = useNavigate(); // AƱade esto