-
[Node.js] MVC 패턴 model 분리 / 로그인 기능 구현(4)
여태까지한 컨트롤러 코드를 봐보면, controller.js "use strict"; const output = { home : (req,res)=>{ res.render("home/index"); }, login : (req,res)=>{ res.render("home/login"); }, }; const users = { id : ["sangmin", "이상민", "hello"], password : ["1234","12345","123456"], }; const process = { login : (req, res) => { const id = req.body.id, password = req.body.password; if(users.id.includes(id)) { const idx = user..
BE/Node.js
2022. 8. 9.