Skip to content

Commit

Permalink
progress
Browse files Browse the repository at this point in the history
  • Loading branch information
emrebilge committed Sep 17, 2023
1 parent 6c68654 commit f55affd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 4 additions & 1 deletion frontend/word-guessing-game/src/GamePage/GamePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ function GamePage() {
const fetchRandomWord = async () => {
try {
const response = await axios.get('http://localhost:5551/get_word'); // Make a GET request to the backend

const randomWord = response.data.scrambledWord;
console.log(randomWord);

setWord(randomWord);
} catch (error) {
console.error('Error fetching word:', error);
Expand All @@ -45,7 +48,7 @@ function GamePage() {
<div className="game-container">
<h2 className="game-title">Guess the Word:</h2>
<div className="game-content">
<p className="scrambled-word">Scrambled Word: {setWord}</p>
<p className="scrambled-word">Scrambled Word: {word}</p>
<input
type="text"
className="guess-input"
Expand Down
2 changes: 0 additions & 2 deletions frontend/word-guessing-game/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@ import App from './App';

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
);

0 comments on commit f55affd

Please sign in to comment.