Express.js Fundamentals - 7 - Templating

preview_player
Показать описание


- Templating is just another way of describing what view layer we're going to use.

- First, we'll look at how to set up our template framework using the engine and set methods.

- We'll see how to set directory locations for reading the view files and other static content.

- Next, take a closer look at a few of the more popular options such as Jade, EJS, Swig, and Handlebars.
Рекомендации по теме
Комментарии
Автор

@7:39 I think handlerbars won't work that way

Need to use hbs instead

Terminal:
npm install hbs --save

Code:
var hbs = require('hbs')

app.engine('html', hbs.__express);
app.set('view engine', 'html');
app.set('views', path.join(__dirname, 'views'));

shocked-curry-omelette
Автор

You should change your sublime font ASAP! ;-)

ShamimKeshani
visit shbcf.ru