diff --git a/gatewayservice/gateway-service.js b/gatewayservice/gateway-service.js index 313f27b..bb3a7c4 100644 --- a/gatewayservice/gateway-service.js +++ b/gatewayservice/gateway-service.js @@ -24,7 +24,7 @@ app.get('/health', (_req, res) => { app.post('/login', async (req, res) => { try { // Forward the login request to the authentication service - const authResponse = await axios.post('/auth/login', req.body); + const authResponse = await axios.post(userServiceUrl + '/auth/login', req.body); res.json(authResponse.data); } catch (error) { console.error(error); @@ -34,7 +34,7 @@ app.post('/login', async (req, res) => { app.post('/adduser', async (req, res) => { try { // Forward the add user request to the user service - const userResponse = await axios.post('/user/adduser', req.body); + const userResponse = await axios.post(userServiceUrl + '/user/adduser', req.body); res.json(userResponse.data); } catch (error) { console.error(error); @@ -44,7 +44,7 @@ app.post('/adduser', async (req, res) => { app.post('/edituser', async (req, res) => { try { // Forward the edit user request to the user service - const userResponse = await axios.post('/user/edituser', req.body); + const userResponse = await axios.post(userServiceUrl + '/user/edituser', req.body); res.json(userResponse.data); } catch (error) { console.error(error); @@ -55,7 +55,7 @@ app.get('/WikiData/GetCapitalsQuestions', async (_req, res) => { try { // Forward the edit user request to the user service console.log(process.env.WIKIDATA_SERVICE_URL); - const wikiResponse = await axios.get(wikidataServiceUrl+'/WikiData/GetCapitalsQuestions'); + const wikiResponse = await axios.get(wikidataServiceUrl + '/WikiData/GetCapitalsQuestions'); res.json(wikiResponse.data); } catch (error) { console.error(error);