[항해99] 노드JS 심화반 숙제
IT/Bootcamp 항해992021. 7. 7. 02:02
항해 99
30일 차:
오늘은 진짜 숙제를 시작해야 할 것 같다.
금 토 일 월, 생각보다 한게없는것같다.
점점 하루하루 씩 쌓이다 보니깐 아는 사람들 도 많아지고 여기저기 구경 가서 잡담만 하느라 시간이 많이 뺏긴다.
내할일은 하고 가서 놀아야 되는데...
시간을 좀 더 효율적으로 써야겠다.
해결한 질문:
<link href="/mystyle.css" rel="stylesheet" />
asset폴더 안에 있는 css를 적용시키고 싶을 때 꼭 "/"를 붙여서 불러와줘야 한다.
const User = require("../schemas/user");
몽구스에서 데이터 스키마 불러올 때와 SQL 이랑 다르다.
const {User} = require("../schemas");
아직 잘 모르는 것 같은 개념:
find one, find 그리고 언제 id , {id}를 쓰는지 확실하게 아는 것 같지 않다.
const existId = await User.findOne({ id: id }).exec();
ajax에서 error message
,error: function (xhr, status, error) {
// error messsage
alert(xhr.responseText)
alert(error.responseJSON.errorMessage)
추가적으로 , joi에서 validate 하지 못하면 error에서 msg부분을 통째로 가져와서 user alert로 보내 주고 싶을 때는 이렇게 쓴다고 한다.
catch (err) {
const msg = err.details[0].message;
console.log(msg);
res.status(400).send({
errorMessage: msg,
});
검색은 joi.ValidationResult.error JavaScript and Node.js code...
Node js자료
https://m.blog.naver.com/azure0777/220469049820
Need :
- study strategy
-efficient time management
반응형
'IT > Bootcamp 항해99' 카테고리의 다른 글
[항해99] 32일차 노드 심화 숙제 (0) | 2021.07.08 |
---|---|
[항해99] 31일차 JWT (2) | 2021.07.08 |
[항해99] 29일차 노드JS , 로그인 구현 , (0) | 2021.07.05 |
[항해99] 26일차 , 27일차 주특기 심화시작 (0) | 2021.07.05 |
[항해99] 25일차 주특기 기본주차 숙제 마감, (0) | 2021.07.02 |
댓글()