mirror of
https://github.com/jsbin/jsbin.git
synced 2026-02-01 16:46:05 +00:00
Allow hogan to render txt files as well as html
This commit is contained in:
parent
f6f3067a53
commit
b750a2b28f
@ -53,7 +53,7 @@ app.use(middleware.jsonp());
|
||||
app.use(middleware.helpers(app));
|
||||
|
||||
// Create a Hogan/Mustache handler for templates.
|
||||
app.engine('html', function (path, options, fn) {
|
||||
function render(path, options, fn) {
|
||||
fs.readFile(path, 'utf8', function (err, template) {
|
||||
if (err) {
|
||||
return fn(err);
|
||||
@ -70,7 +70,8 @@ app.engine('html', function (path, options, fn) {
|
||||
fn(error);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
app.engine('html', render).engine('txt', render);
|
||||
|
||||
// Events
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user