Skip to content

Commit

Permalink
Arreglado falta de variables de entorno. Mansi tq
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-qg committed Mar 14, 2024
1 parent 0f7269c commit 9564ba2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion webapp/src/components/FirstGame.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const Quiz = () => {

const getQuestions = async () => {
try {
const response = await axios.get(`${apiEndpoint}/questions?n_preguntas=${1}`);
const response = await axios.get(`${apiEndpoint}/questions`);
console.log(response.data.length)
for (var i = 0; i < response.data.length; i++) {
var possibleAnswers = [response.data[i].respuesta_correcta, response.data[i].respuestas_incorrectas[0], response.data[i].respuestas_incorrectas[1], response.data[i].respuestas_incorrectas[2]]
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/components/Menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'react-circular-progressbar/dist/styles.css';
import axios from 'axios';
import { useNavigate } from 'react-router-dom'; // Importa useHistory

const apiEndpoint = 'http://localhost:8007';
const apiEndpoint = process.env.REACT_APP_API_ENDPOINT|| 'http://localhost:8000';


var isApiCalledRef = false;
Expand Down Expand Up @@ -66,7 +66,7 @@ const Menu = () => {
const getQuestions = async () => {
try {
setn_preguntas(5)
const response = await axios.get(`${apiEndpoint}/questions?n_preguntas=${n_preguntas}`);
const response = await axios.get(`${apiEndpoint}/questions`);
console.log(response.data.length)
for (var i = 0; i < response.data.length; i++) {
var possibleAnswers = [response.data[i].respuesta_correcta, response.data[i].respuestas_incorrectas[0], response.data[i].respuestas_incorrectas[1], response.data[i].respuestas_incorrectas[2]]
Expand Down

0 comments on commit 9564ba2

Please sign in to comment.