Skip to content

Commit

Permalink
Score update
Browse files Browse the repository at this point in the history
Score for game and rankings
  • Loading branch information
andrrsin authored Apr 6, 2024
2 parents dd89602 + 87e04c8 commit 333fed5
Show file tree
Hide file tree
Showing 7 changed files with 416 additions and 26 deletions.
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}"
}
]
}
8 changes: 7 additions & 1 deletion gatewayservice/gateway-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,15 @@ app.get('/imgs/foods/question', async (req, res) => {
app.post('/imgs/answer', async (req, res) => {
try {
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:answer, question:question}, { headers: {'Content-Type': 'application/json'} });
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) {
res.status(error.response.status).json({ error: error.response.data.error });
Expand Down
Loading

0 comments on commit 333fed5

Please sign in to comment.