Skip to content

Express App with Handlebar Templating Engine

haoliu119 edited this page Aug 16, 2013 · 5 revisions
  1. Do a Clean Install of an Express App, or use a boilerplate by lazd
    • Caveat: Express uses Jade as the default tempalting engine
  2. Replace Jade with Handlebars (hbs)
    • Why? then you can use the same templating engine for both frontend and backbend
    1. Install Express.js view engine for handlebars.js
      • use --save-dev to automatically save to package.json file
    2. [Use partials](Express.js view engine for handlebars.js) (instruction at bottom of page)
    3. Use Extend and Block helper functions - helper function definitions and sample views
Clone this wiki locally