findOne: (email) => {
let userbyemail=[]
http.get(`http://localhost:8080/auth/user/email/${email}`,resp =>{
let data = "";
resp.on("data",chunk =>{
data += chunk
})
req.on('end', () => {
const user = JSON.parse(data)[0]
userbyemail = user
})
})
if (userbyemail.email === email){
return userbyemail;
}
return null
},
I want to save the user information to a variable outside of the Http scope, what can i do?