Skip to content

Commit

Permalink
Merge pull request #112 from Arquisoft/build_sergiot
Browse files Browse the repository at this point in the history
Deployment fixes
  • Loading branch information
sergiollende authored Mar 14, 2024
2 parents 85e79e5 + d8110db commit 8034a8d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions gatewayservice/gateway-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const port = 8000;

const authServiceUrl = process.env.AUTH_SERVICE_URL || 'http://localhost:8002';
const userServiceUrl = process.env.USER_SERVICE_URL || 'http://localhost:8001';
const wikidataServiceUrl = process.env.WIKIDATA_SERVICE_URL || 'http://localhost:7259';

app.use(cors());
app.use(express.json());
Expand Down Expand Up @@ -41,6 +42,15 @@ app.post('/adduser', async (req, res) => {
}
});

app.get('/WikiData/getCapitalQuestions', async (_req, res) => {
try {
const userResponse = await axios.get(wikidataServiceUrl+'/WikiData/getCapitalQuestions', req.body);
res.json(userResponse.data);
} catch (error) {
res.status(error.response.status).json({ error: error.response.data.error });
}
});

// Start the gateway service
const server = app.listen(port, () => {
console.log(`Gateway Service listening at http://localhost:${port}`);
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/stores/playing-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ interface GameQuestions{
}

const retrieveQuestions = () => {
return fetch('https://localhost:7259/WikiData/GetCapitalsQuestions')
return fetch('/WikiData/GetCapitalsQuestions')
.then((response) => response.json())
.catch((error) => {
console.error('There was a problem with the questions:', error);
Expand Down

0 comments on commit 8034a8d

Please sign in to comment.