Nodemon: tự động restart lại server nodejs
Tedious: Connect với mssql (Giống mssql-npm)
Express: frameword cho nodeJS - Giống Hapi
Sails: Fulltack FrameWord cho nodejs (cái này hay nè)
Sequilize: ORM dùng để mapping CSDL
ejs: view template
date-format: định dạng ngày tháng năm (Chú ý nếu cần định dạng về UTC +7 thì cần cấu hình lại trong file config hoặc connect : timezone: '+07:00',
dotenv:...
-
This is Slide 1 Title
This is slide 1 description. Go to Edit HTML and replace these sentences with your own words. This is a Blogger template by Lasantha - PremiumBloggerTemplates.com...
-
This is Slide 2 Title
This is slide 2 description. Go to Edit HTML and replace these sentences with your own words. This is a Blogger template by Lasantha - PremiumBloggerTemplates.com...
-
This is Slide 3 Title
This is slide 3 description. Go to Edit HTML and replace these sentences with your own words. This is a Blogger template by Lasantha - PremiumBloggerTemplates.com...
Thứ Hai, 20 tháng 1, 2020
Sử dụng EJS làm view cho node JS
By Hoàng Duy at 15:42
No comments

Các bước cấu hình
1. Cài đặt các gói cần thiết
#npm install --save ejs
#npm install --save bootstrap
#npm install --save jquery
#npm install --save popper
2. Tạo 1 thư mục views
- Folder: include : chưa cái file được xử dụng lại như : header, footer. nav
- 2 file: index.ejs, about.ejs
index.ejs
<!DOCTYPE html>
<html lang="en">
<% include ('./include/head') %>
<body>
<% include ('./include/nav') %>
<div class="container">
<div class="row">
<h1>Home</h1>
</div>
<hr>
<div class="row">
<p style="height:300px;">Content Here...</p>
</div>
</div>
<% include ('./include/scripts') %>
<% include ('./include/footer') %>
</body>
</html>
about.ejs
<!DOCTYPE html>
<html lang="en">
<% include ('./include/head') %>
<body>
<% include ('./include/nav') %>
<div class="container">
<div class="row">
<h1>About</h1>
</div>
<hr>
<div class="row">
<p style="height:300px;">Content Here...</p>
</div>
</div>
<% include ('./include/scripts') %>
<% include ('./include/footer') %>
</body>
</html>
Cầu...