diff --git a/gatewayservice/gateway-service.js b/gatewayservice/gateway-service.js index c09eb16..43d570f 100644 --- a/gatewayservice/gateway-service.js +++ b/gatewayservice/gateway-service.js @@ -42,9 +42,9 @@ app.post('/adduser', async (req, res) => { } }); -app.get('/WikiData/getCapitalQuestions', async (_req, res) => { +app.get('/WikiData/GetCapitalQuestions', async (_req, res) => { try { - const userResponse = await axios.get(wikidataServiceUrl+'/WikiData/getCapitalQuestions', req.body); + const userResponse = await axios.get(wikidataServiceUrl+'/WikiData/GetCapitalQuestions', req.body); res.json(userResponse.data); } catch (error) { res.status(error.response.status).json({ error: error.response.data.error }); diff --git a/webapp/src/services/auth-service.ts b/webapp/src/services/auth-service.ts index f09a188..7f9d5a5 100644 --- a/webapp/src/services/auth-service.ts +++ b/webapp/src/services/auth-service.ts @@ -3,7 +3,7 @@ import { jwtDecode } from "jwt-decode"; import { useUserStore } from '../stores/user-store'; import { useStats } from '../stores/playing-store'; -const API_URL = 'http://localhost:8002'; +const API_URL = process.env.REACT_APP_API_ENDPOINT || 'http://localhost:8000'; export type JwtPayload = { username: string; diff --git a/webapp/src/stores/playing-store.ts b/webapp/src/stores/playing-store.ts index e0032b3..4a9abb7 100644 --- a/webapp/src/stores/playing-store.ts +++ b/webapp/src/stores/playing-store.ts @@ -56,8 +56,10 @@ interface GameQuestions{ startGame: () => void } +const API_URL = process.env.REACT_APP_API_ENDPOINT || 'http://localhost:8000'; + const retrieveQuestions = () => { - return fetch('/WikiData/GetCapitalsQuestions') + return fetch(`${API_URL}/WikiData/GetCapitalsQuestions`) .then((response) => response.json()) .catch((error) => { console.error('There was a problem with the questions:', error);