Skip to content

Commit

Permalink
Merge pull request #60 from Arquisoft/fix-deployment
Browse files Browse the repository at this point in the history
Fix Deployment
  • Loading branch information
didierrc authored Mar 12, 2024
2 parents 9f5f7db + 65e1494 commit 3db0f65
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
4 changes: 2 additions & 2 deletions questionservice/src/services/question-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ async function generateQuestions(n: number): Promise<object[] | void> {
const randomQuestionsTemplates = await QuestionModel.aggregate([
{ $sample: { size: n } },
]);
console.log('124');
console.log(randomQuestionsTemplates[0].question_type.name);
// console.log('124');
// console.log(randomQuestionsTemplates[0].question_type.name);

// Generate and return questions generated from those documents
const questionsArray = await generateQuestionsArray(
Expand Down
20 changes: 9 additions & 11 deletions webapp/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import Profile from "./pages/Profile/Profile"
import Leaderboard from "./pages/Leaderboard/Leaderboard"
import Settings from "./pages/Settings/Settings"
import Home from "./pages/Home/Home"
import data from "./assets/data.json"

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

function App() {
//State for opening and closing the navigation
Expand All @@ -20,15 +21,12 @@ function App() {
const [questions, setQuestions] = useState([])

useEffect(() => {
console.log(questions)
; (async () => {
const questions = await getQuestions()
setQuestions(questions)
console.log(questions)
})()

console.log(questions)
}, [])
; (async () => {
const questions = await getQuestions()
setQuestions(questions)
console.log(questions)
})()
})

//State for the theme
const [theme, setTheme] = useState("light")
Expand Down Expand Up @@ -63,7 +61,7 @@ function App() {
}

const getQuestions = async () => {
const response = await fetch((process.env.API_URI || 'http://localhost:8000') + "/questions?size=3")
const response = await fetch(apiEndpoint + "/questions?size=3")
console.log(response)
const data = await response.json()

Expand Down
File renamed without changes.

0 comments on commit 3db0f65

Please sign in to comment.