update this for express 3.0
Currently tj merged in hjs - which seems way worse then what you have here (doesn't seem to support partials, etc.).
Would be cool to update this plugin and get it merged instead
Could you be more specific? What is "tj"? Hjs means hogan.js? Add some link etc. Thanks.
sure sorry - tj == visionmedia (the author of express).
He's working on releasing version 3 of express - and has merged in a plugin called hjs (https://github.com/nullfirm/hjs).
Here's the first relevant commit in express: https://github.com/visionmedia/express/commit/18083f0c13b07705a906beda881628f5991264f8#L0R25
The hjs plugin doesn't appear to support a lot of things (one of which is partials). I was thinking it would be cool to update your plugin to work with the new version of express (slightly different syntax).
If you don't have time, that's cool too. Just thought i'd point it out.
Ok, I will try to do so.
Hi, support for Express 3 should be done. Do you think I should contact tj?
Didn't work for me. Here's the test script :
var express = require('express');
var expressHogan = require('express-hogan.js'); // require('express-hogan.js')
var app = express.createServer();
app.configure(function() {
app.set('views', __dirname + '/views');
app.engine('hjs', expressHogan.renderFile);
});
app.get('/', function(req, res) {
res.locals = {
title: 'Express test',
message: 'using Hogan templating system'
};
return res.render('index.hjs');
});
app.listen(3000);
console.log('Express server listening on port 3000');
And the error output :
/node_modules/express/lib/application.js:172
if ('function' != typeof fn) throw new Error('callback function required');
^
Error: callback function required
My express version is 3.0.5
Works for me. Are you using master of this library? I just published it to npmjs as version 0.3.0 as well.