강의

멘토링

커뮤니티

Inflearn Community Q&A

truth8091660's profile image
truth8091660

asked

Node and React series that you can learn by following - Basic lecture

Node React Basics Lecture #12 Token Generation with jsonwebtoken

질문있습니다!

Resolved

Written on

·

198

0

User.js 에서

//스키마를 모델로 감싸기
const User = mongoose.model('User'userSchema)
//다른 곳에서 쓸수잇게
module.exports = { User }

이부분을 제일 하단에 놓느냐 마느냐에 따라서 오류가 생기는데

이유좀 알고싶어요

로그인 할때 안되서 코드오타 찾다가 위치를 수정하니까 되더라구요

reactnodejs

Answer 2

1

John Ahn님의 프로필 이미지
John Ahn
Instructor

안녕하세요 truth님    
서버에서 소스를 읽어 내려갈 때 위에서 아래로 내려가면서 읽기 때문에 
먼저 위에서 작성한 로직을 유저 변수에 넣은 후 exports를 해줘야하기 떄문에 하단에 놔주어야합니다 ~ 

0

truth809님의 프로필 이미지
truth809
Questioner

감사합니다 강사님!! 새해 복 많이 받으세요~!!^^

truth8091660's profile image
truth8091660

asked

Ask a question