From 2a5ebec60b992b7671c5fe848c92a873ff296977 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Fern=C3=A1ndez=20Noriega?= Date: Mon, 8 Apr 2024 08:01:07 +0200 Subject: [PATCH] Hot fix: call to addpoints was not using gateway and causing score not to work in deployed version --- questionservice/question-service.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/questionservice/question-service.js b/questionservice/question-service.js index 512809c..adc4b4e 100644 --- a/questionservice/question-service.js +++ b/questionservice/question-service.js @@ -8,7 +8,7 @@ const app = express(); const port = 8010; const axios = require('axios'); -const userServiceUrl = process.env.USER_SERVICE_URL || 'http://localhost:8001'; +const apiEndpoint = process.env.REACT_APP_API_ENDPOINT || 'http://localhost:8000'; app.use(express.static('public')); @@ -214,13 +214,13 @@ app.post('/imgs/answer', async (req, res) => { const obj = req.body; if (obj.question == answerToQuestionMap.get(obj.answer)) { - await axios.post(userServiceUrl + '/addpoints', + await axios.post(apiEndpoint + '/addpoints', { username: obj.username, category: obj.category, correct: "true" }); res.status(200).json({ correct: "true", }) } else { - await axios.post(userServiceUrl + '/addpoints', + await axios.post(apiEndpoint + '/addpoints', { username: obj.username, category: obj.category, correct: "false" }); res.status(200).json({