Permalink
Browse files

use app.engine in more recent versions of express

  • Loading branch information...
1 parent c22ca54 commit ac6459164d7594cde1b6c09ba6a2c1616e6dd299 @jneen committed Sep 7, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/express-handlebars.js
@@ -1,6 +1,9 @@
module.exports = function(app, Handlebars) {
// *.hbs templates are rendered with Handlebars
- app.register('hbs', Handlebars);
+ // different versions of express have differently-named methods for this.
+ // see https://github.com/visionmedia/express/commit/66f8ca52d6fc5ea567ebe3d85515595f097f42dc
+ var engineMethod = app.engine || app.register;
+ engineMethod.call(app, 'hbs', Handlebars);
// hook into express's native helpers function to register helpers
// with Handlebars

0 comments on commit ac64591

Please sign in to comment.