Skip to content

Commit

Permalink
Merge pull request #90 from Arquisoft/christian-tests
Browse files Browse the repository at this point in the history
Question service tests completed and passing
  • Loading branch information
adriiglz authored Apr 6, 2024
2 parents a794bea + caea032 commit dd89602
Show file tree
Hide file tree
Showing 7 changed files with 4,222 additions and 289 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
3 changes: 2 additions & 1 deletion gatewayservice/gateway-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,9 @@ app.get('/imgs/foods/question', async (req, res) => {
app.post('/imgs/answer', async (req, res) => {
try {
const answer = req.body.answer;
const question = req.body.question;
// Forward the request to the question service
const questionResponse = await axios.post(questionServiceUrl+'/imgs/answer', answer, { headers: {'Content-Type': 'text/plain'} });
const questionResponse = await axios.post(questionServiceUrl+'/imgs/answer', {answer:answer, question:question}, { headers: {'Content-Type': 'application/json'} });
res.json(questionResponse.data);
} catch (error) {
res.status(error.response.status).json({ error: error.response.data.error });
Expand Down
Loading

0 comments on commit dd89602

Please sign in to comment.