반응형
1. Template engine
html을 직접 타이핑하여 코딩하는 귀찮음을 덜어주는 언어
pug
express와 함께 자주 사용되는 template engine. 적은 코드를 이용하여 많은 html코드를 자동으로 입력할 수 있다.
(ex)
Template engine 사용하기
pug를 사용할 경우
npm install pug --save
로 설치하고 위의 페이지의 아래에 놓인 코드들을 작성하게 되면 사용할 수 있다.
2. Database
웹 애플리케이션에서 데이터베이스는 필수이다. 데이터베이스별로 존재하는 드라이브를 설치한 후 웹 애플리케이션을 만들면 된다.
예로 들어서 mySQL를 통합하고 싶다면, mySQL드라이브를 npm install mysql을 통해 설치하고, 아래 예제들을 통해 express 애플리케이션 내에서 데이터베이스를 제어할 수 있다.
3. Middleware
Express에서 가장 중요한 부분이다. 이의 기능을 대부분 지원하기 때문이다.
middleware를 많이 알수록 express를 고급적으로 사용할 수 있다.
위의 사이트를 잘 살펴보고, third-party middleware의 종류에 대해서도 잘 알아놓자.
반응형
'Back-End > Node.js' 카테고리의 다른 글
Express - 페이지 라우팅 (0) | 2020.09.08 |
---|---|
Express - app.js 소스 살펴보기 (0) | 2020.09.08 |
Express - 16. express generator (0) | 2020.09.08 |
Express - 15. 보안 (0) | 2020.09.08 |
Express - 14.3. 라우터 - 파일로 분리 - index (0) | 2020.09.08 |