TABLE1 [Nodejs-mysql] 테이블 만들고 모듈 분리하기 [생활코딩] 저자 목록 보기 기능 구현 main.js var author = require('./lib/author'); else if(pathname === '/author'){ author.home(request,response); } lib/author.js var db = require('./db'); var template = require('./template.js'); exports.home = function(request, response){ db.query('SELECT*FROM topic', function(error, topics){ db.query('SELECT*FROM author', function(error2, authors){ // author데이터 불러와 authors에 .. 2020. 8. 7. 이전 1 다음 반응형