issues
search
finalproject-quiz
/
quiz-project
0
stars
0
forks
source link
Connect front end to backend
#22
Open
ShalimaKhanum2605
opened
1 year ago
ShalimaKhanum2605
commented
1 year ago
Technical Implementation
created useEffect function that sends request for data from backend server (fetch from URL from backend)
returned state with updated data (res.json)
created login function that takes user's data of name as a string
sends request to backend to users endpoint
method is post request which is sending data to backend
content type is header and the body is where its being sent (body: JSON.stringify({ name: user, score: 0 }))
name is the class User's public string in Quiz.cs set to the User's input of their username
score is set to initially 0
ShalimaKhanum2605
commented
1 year ago
Technical Implementation