Express Templates

app.set('view engine', 'jade');
app.set('views', './templates');
// templates/thoughts.jade
html
  head
    title= title
  body
    h1 Express is... #{descriptor}!
var data = {
  title: 'My views on Express',
  descriptor: 'great'
};
res.render('thoughts', data);
Express Templates app.set('view engine', 'jade'); app.set('views', './templates'); // templates/thoughts.jade html head title= title body h1 Express is... #{descriptor}! var data = { title: 'My views on Express', descriptor: 'great' }; res.render('thoughts', data); Finally I'll tell you how res.render works!! 1. setup (aside re: app.get, app.set) 2. here's the template file - uses whitespace/nesting - two main ways to inject data: tagname= #{descriptor} 3. Here's how we call it