Skip to content

Commit

Permalink
Hot fix: call to addpoints was not using gateway and causing score no…
Browse files Browse the repository at this point in the history
…t to work in deployed version
  • Loading branch information
ChristianFN2 committed Apr 8, 2024
1 parent 157a0b5 commit 2a5ebec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions questionservice/question-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down Expand Up @@ -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({
Expand Down

0 comments on commit 2a5ebec

Please sign in to comment.