[server]

김린네·2022년 12월 26일
  1. db(model).findOne({email: ''}).then(find=> 여기서 res.send 하면 안된다.
    여기서는 전역 변수에 값을 설정해주고 다 끝나면 보내는 식으로 간다.
exports.getlogin_name = async (req, res, next) => {
 const user_email = req.body.email;
 console.log(user_email, '서버이메일')
 var cehck = 0;
 await User.findOne({ email: user_email }
 ).then(find => {
  //res.send(1)
  console.log(find);
  cehck = 1;
 })

 res.send(cehck.toString())
}
profile
디자인 > https://dribbble.com/jongpil_77 코딩 > https://www.codewars.com/users/bikijjang

0개의 댓글