Skip to content

Commit

Permalink
Merge pull request #114 from Arquisoft/hot-fix-deploy
Browse files Browse the repository at this point in the history
Another fix for question service score
  • Loading branch information
uo287841 authored Apr 8, 2024
2 parents 2a5ebec + 8766331 commit 4876433
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,14 @@ services:
build: ./questionservice
depends_on:
- mongodb
- userservice
ports:
- "8010:8010"
networks:
- mynetwork
environment:
MONGODB_URI: mongodb://mongodb:27017/userdb
USER_SERVICE_URL: http://userservice:8001
# platform: linux/arm64
gatewayservice:
container_name: gatewayservice-${teamname:-defaultASW}
Expand Down
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 apiEndpoint = process.env.REACT_APP_API_ENDPOINT || 'http://localhost:8000';
const userServiceUrl = process.env.USER_SERVICE_URL || 'http://localhost:8001';


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(apiEndpoint + '/addpoints',
await axios.post(userServiceUrl + '/addpoints',
{ username: obj.username, category: obj.category, correct: "true" });
res.status(200).json({
correct: "true",
})
} else {
await axios.post(apiEndpoint + '/addpoints',
await axios.post(userServiceUrl + '/addpoints',
{ username: obj.username, category: obj.category, correct: "false" });

res.status(200).json({
Expand Down

0 comments on commit 4876433

Please sign in to comment.