2011-07-26 4 views

答えて

20
var _ = require('underscore'); 

app.register('.html', { 
    compile: function (str, options) { 
    var template = _.template(str); 
    return function (locals) { 
     return template(locals); 
    }; 
    } 
}); 
+0

注:これは、アップ特急<3足の – UpTheCreek

4

これでExpress 3.0では、少し異なります。簡単な解決策: https://github.com/haraldrudell/uinexpress

npm install uinexpress 

その後、

app.configure(function() { 
app.engine('html', require('uinexpress').__express) 
app.set('view engine', 'html') 
+0

親指用で、これは私のために素晴らしい仕事 –

関連する問題