boiler-plate(2)

강지훈·2022년 7월 21일
0

https://www.youtube.com/watch?v=E6eJiBYgULw&list=PL9a7QRYt5fqly7BrCxOS71BqLLb9OeXKd&index=5

4강에서는 모델 폴더안에
모델파일만드는것 > user.js
에서 몽구스 불러오는거 코딩했음

const mongoose = require("mongoose");

//schema 만들기
const userSchema = mongoose.Schema({
name: {
type: String,
maxlength: 50,
},
email: {
type: String,
trim: true,
unique: 1,
},
password: {
type: String,
minlength: 5,
},
lastname: {
type: String,
maxlength: 50,
},
role: {
type: Number,
default: 0, //nomal user
},
token: {
type: String,
},
tokenExp: {
type: Number,
},
});

const User = mongoose.model("User", userSchema);

module.exports = { User };

5강에서는 git을 쓰는 방법을 가르쳐줌

boiler-plate(1) 에서
node module 이걸 .gitignore에 추가해서
깃에 못올리는거를 먼저했는데
5강에서 다루네...

오늘 할당량 끝!

profile
never stop

0개의 댓글