static1 [Nodejs-express] 정적인 파일 사용하기 [생활코딩] 정적인 파일의 서비스 app.use(express.static('public')); // public 디렉토리 안에서 static 파일을 찾겠다는 코드 public/images 폴더 안에 img01.jpg라는 파일이 있다면 http://localhost:3000/images/img01.jpg 로 접속시 이미지가 나옴 본문에서 사용하기 app.get('/', function(req, res){ var title = 'Welcome'; var description = 'Hello, Node.js'; var list = template.list(req.list); var html = template.HTML(title, list, `${title}${description} `, `create` ).. 2020. 8. 9. 이전 1 다음 반응형