
1. Document 만들기 - schema는 video의 구성요소와 데이터 형태를 갖추고 있음 - 유저가 비디오를 업로드할 때 해당 schema의 데이터들을 전송 - 생성일이나 meta 데이터는 자동으로 생성 - 비디오를 생성하려면 document가 필요함 // upload.pugextends baseblock content form(method="POST") input(placeholder="Title", required, type="text", name="title") input(placeholder="Description", required, type="text", name="description") input(placeholder="Hashtags,..
const handleHome = (req, res) => { return res.send("what the?");};const handleLogin = (req, res, next) => { next(); console.log(1); return res.send("login");};app.get("/", handleHome);app.get("/login", handleLogin, handleHome); - 복습하던 도중 middleware를 이렇게 만들어봄 - localhost/login으로 이동하면 정상적으로 what the? 라는 p태그의 내용이 출력됐지만 콘솔에 1과 함께 에러가 발생 - 해당 에러는 서버가 클라이언트에게 2개 이상의 응답을 보낼 때 발생한다고 함 - next()를 호출하면..