
웹 서버 생성 관련 기능 담당 프레임워크
Embadded Javascript
<%%> 코드
<% = %> 변수 값 출력
<% - include(ejs 파일 경로, ejs 파일에 전달할 데이터) %> : ejs에서 또 다른 ejs 불러옴
<%#%> ejs 태그 주석
문법, 설정에 따라 파일 => html 형식으로 변환시키는 모듈
ex) ejs, pug, handlebars 등

서버 구축, 개방, 각 ejs 파일로의 연결, DB 발신 등 지정 파일
ejs 파일마다 중복되는 내용인 title, css link, js script src 들어있음.
<title><%= title%>></title>
위 구문을 통해 각 ejs 파일마다 다른 title을 줌
각 페이지들을 구성하는 파일들로서 include 구문을 통한 head, header 파일들 역시 호출
<!-- ejs에서 또 다른 ejs 불러옴 -->
<%- include("./includes/head",{title:"Home"}) %>
정적 웹 컨텐츠인 html,css,js 파일들 저장

/* static 미들웨어 등록*/
app.use("/public", express.static(__dirname + "/static"));
//사용자에게 보여지는 url, 폴더명
// console.log(__dirname); //c:\Users\user\Desktop\Sesac-Ydp-5\08_express
// console.log(__dirname + "/static"); //c:\Users\user\Desktop\Sesac-Ydp-5\08_express/static
// img 보려면
// http://localhost:8080/public/img/zq.jpg
위 구문을 통해 등록된 미들웨어를 통해 접근 가능
home, header ejs 파일에 대한 css 지정되어 있음
js 파일 저장되어 있음