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({