Skip to content

Commit

Permalink
Merge branch 'develop' into dev_score, modified:
Browse files Browse the repository at this point in the history
- Question.jsx, call to gateway inside function answerQuestion()
- gateway-service.js: Route /imgs/answer
- question-service.js: take new params andsend correct messages
  • Loading branch information
uo287841 committed Apr 6, 2024
2 parents 2eace1d + dd89602 commit 87e04c8
Show file tree
Hide file tree
Showing 7 changed files with 4,278 additions and 375 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ jobs:
- run: npm --prefix users/authservice ci
- run: npm --prefix users/userservice ci
- run: npm --prefix gatewayservice ci
- run: npm --prefix questionservice ci
- run: npm --prefix webapp ci
- run: npm --prefix questionservice test -- --coverage
- run: npm --prefix users/authservice test -- --coverage
- run: npm --prefix users/userservice test -- --coverage
- run: npm --prefix gatewayservice test -- --coverage
Expand Down
5 changes: 4 additions & 1 deletion gatewayservice/gateway-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,12 @@ app.post('/imgs/answer', async (req, res) => {
const answer = req.body.answer;
const username = req.body.username;
const category = req.body.category;
const question = req.body.question;

// Forward the request to the question service
const questionResponse = await axios.post(questionServiceUrl+'/imgs/answer', {answer, username, category }, { headers: {'Content-Type': 'text/plain'} });
const questionResponse = await axios.post(questionServiceUrl+'/imgs/answer',
{answer:answer, question: question, username: username, category: category },
{ headers: {'Content-Type': 'application/json'} });

res.json(questionResponse.data);
} catch (error) {
Expand Down
Loading

0 comments on commit 87e04c8

Please sign in to comment.