서버를 시작하고 홈페이지나 어바웃 페이지에 가보면 뷰가 렌더링되는 걸 확인할 수 있습니다.
소스를 보면
views
/
layouts
/
main
.
handlebars
에서 만든 템플릿
HTML
이 들어 있을 겁니다.
3.3.2.
정적 파일과 뷰
익스프레스는 미들웨어를 통해 정적 파일과 뷰를 처리합니다. 미들웨어는
10
장에서 더 자세히
설명합니다. 지금은 미들웨어에서 정규화를 해주므로 요청 처리가 더 쉽다는 것만 기억하면 충
분합니다.
static
미들웨어는 정적 자원을 담고 있는 하나 이상의 디렉터리를 지목해서 특별한 처리 없
이 클라이언트에 전송할 수 있게 해줍니다. 이 디렉터리에 이미지,
CSS
파일, 클라이언트 자바
스크립트 파일 등을 저장합니다.
프로젝트 디렉터리 안에
public
서브디렉터리를 만듭니다. 이 디렉터리를
public
이라 부르는
건 이 디렉터리 안
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.
O’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
I wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
I’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
I'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.