Skip to Content
한 권으로 끝내는 Node & Express(2판): 모던 웹을 위한 서버 사이드 자바스크립트의 모든 것
book

한 권으로 끝내는 Node & Express(2판): 모던 웹을 위한 서버 사이드 자바스크립트의 모든 것

by 한선용, 이선 브라운
May 2021
Beginner to intermediate
448 pages
9h 47m
Korean
Hanbit Media, Inc.
Content preview from 한 권으로 끝내는 Node & Express(2판): 모던 웹을 위한 서버 사이드 자바스크립트의 모든 것
408
한 권으로 끝내는 Node & Express
handlers
.
js
를 수정하는 부분에 폼 처리 핸들러만 들어 있는데, 역시 사진 콘테스트 폼 핸들
러와 감사 인사 페이지 핸들러가 빠져 있습니다. 감사 인사 페이지 핸들러에서도 앱 파일과 마
찬가지로
Process
는 뺐습니다.
exports.vacationPhotoContest = (req, res) => {
const now = new Date()
res.render(‘contest/vacation-photo’,
{ year: now.getFullYear(), month: now.getMonth() })
}
exports.vacationPhotoContestProcess = (req, res, fields, files) => {
console.log(‘field data: ‘, fields)
console.log(‘files: ‘, files)
res.redirect(303, ‘/contest/vacation-photo-thank-you’)
}
exports.vacationPhotoContestThankYou = (req, res) => {
res.render(‘contest/vacation-photo-thank-you’)
}
파일 업로드 폼을 처리할 라우트 핸들러를 만든 다음 예제를 테스트해보면
500
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

한 권으로 끝내는 Node & Express: 웹사이트 구축을 위한 서버 사이드 자바스크립트

한 권으로 끝내는 Node & Express: 웹사이트 구축을 위한 서버 사이드 자바스크립트

한성용, 이선 브라운

Publisher Resources

ISBN: 9791162244227