Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generación preguntas #2 #22

Merged
merged 26 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b472174
Varios generadores añadidos
CANCI0 Feb 6, 2024
2522a45
Más generadores de preguntas
CANCI0 Feb 6, 2024
7662479
Añadido automatizador de generación de preguntas
CANCI0 Feb 6, 2024
6a53c8d
Nombres más intuitivos en los parámetros
CANCI0 Feb 6, 2024
68f1441
Se ha optimizado el sistema de generación de preguntas
CANCI0 Feb 10, 2024
f00c5ee
Parece haberse solucionado la repetición de respuestas
CANCI0 Feb 10, 2024
25482a8
Más correciones
CANCI0 Feb 10, 2024
756cb9e
Ya no se repiten respuestas
CANCI0 Feb 10, 2024
de7f327
Se ha cambiado el sistema de generación de preguntas
CANCI0 Feb 11, 2024
b13911a
Se ha ampliado el nuevo algoritmo
CANCI0 Feb 11, 2024
96ffe70
Funciona
CANCI0 Feb 11, 2024
13b8f75
Se evita que las respuestas tengan el nombre de la entidad de Wikidata
CANCI0 Feb 11, 2024
4ad1271
Añadida pregunta de esperanza de vida media
CANCI0 Feb 11, 2024
a5130d8
No sabía que existía el includes()
CANCI0 Feb 11, 2024
c9d2ff0
Añadida pregunta de forma de gobierno
CANCI0 Feb 11, 2024
5ece36f
Cambios menores
CANCI0 Feb 11, 2024
ae426e1
Más cambios menores
CANCI0 Feb 11, 2024
e9ed74e
Implementado generador genérico
CANCI0 Feb 12, 2024
0db082a
Se ha implementado una api básica
CANCI0 Feb 12, 2024
26b655b
Servicio añadido a la API
CANCI0 Feb 12, 2024
fce6620
Bug fix
CANCI0 Feb 12, 2024
09decfc
Pequeño error
CANCI0 Feb 13, 2024
dee6e7e
Añadida categoría famosos
CANCI0 Feb 13, 2024
49ff87c
Merge branch 'GeneraciónPreguntas-#2' of https://github.com/Arquisoft…
CANCI0 Feb 13, 2024
d749311
.
CANCI0 Feb 13, 2024
eca107a
Merge remote-tracking branch 'origin/master' into GeneraciónPreguntas-#2
CANCI0 Feb 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 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 questionServiceUrl = process.env.QUESTION_SERVICE_URL || 'http://localhost:8003';

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

app.get('/randomQuestion', async (req, res) => {
try {
// Forward the question request to the question service
const questionResponse = await axios.get(questionServiceUrl+'/randomQuestion', req.body);
res.json(questionResponse.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
57 changes: 57 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"dependencies": {
"cross-fetch": "^4.0.0",
"date-fns": "^3.3.1",
"react-auth-kit": "^3.0.2-alpha.19"
}
}
Loading