User(사용자) 만들기
새로운 스키마가 필요해졌다. 사용자는 영상과는 다른 정보 이므로 새로운 스키마를 만들어준다. import mongoose from "mongoose"; const userSchema = new mongoose.Schema({ email: { type: String, required: true, unique: true }, username: { type: String, required: true, unique: true }, password: { type: String, required: true }, name: { type: String, required: true }, location: String, }); const User = mongoose.model("User", userSchema); expo..
영상 수정하기
extends base.pug block content h4 영상을 수정해보세요! form(method="POST") input(name="title", placeholder="Video Title" ,value=video.title,required) input(placeholder="영상 설명을 해주세요." , required,type="text",name="description",value=video.description) input(placeholder="해시태그, 여러개를 콤마로 구분하여 작성해보세요." , required,type="text",name="hashtags",value=video.hashtags.join()) input(type="submit", value="Save") 일단 영상수..
Video 만들기
이제 실제로 db에 들어갈 영상을 만들어보자. 일단 영상제목 뿐만 아니라, 영상 설명, 해시태그까지 입력할 수 있는 input을 업로드 페이지에 추가한다. 이때 input의 name은 모두 달라야 한다. extends base.pug block content form(method="POST") input(placeholder="영상 제목" , required,type="text",name="uploadTitle") input(placeholder="영상 설명" , required,type="text",name="description") input(placeholder="해시태그, 여러개 작성이 가능해요." , required,type="text",name="hashtags") input(type="sub..