Skip to content

Commit

Permalink
fix gateway endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
pelazas committed Mar 5, 2024
1 parent de81992 commit 207052f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,15 @@ services:
- mongodb
- userservice
- authservice
- questiongeneratorservice
ports:
- "8000:8000"
networks:
- mynetwork
environment:
AUTH_SERVICE_URL: http://authservice:8002
USER_SERVICE_URL: http://userservice:8001
QG_SERVICE_URL: http://qgservice:8003
QG_SERVICE_URL: http://questiongeneratorservice:8003

webapp:
container_name: webapp-${teamname:-defaultASW}
Expand Down
8 changes: 3 additions & 5 deletions gatewayservice/gateway-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,10 @@ app.post('/adduser', async (req, res) => {

app.get('/questionsGame', async (req, res) => {
try {
const response = await axios.get(qgServiceUrl+'/game');
const questions = response.data;
res.json(questions);

const response = await axios.get("http://questiongeneratorservice:8003/game", req.body);
res.json(response.data);
} catch (error) {

console.error(error);
res.status(500).json({ error: 'Internal server error' });
}
});
Expand Down

0 comments on commit 207052f

Please sign in to comment.