hyper.io-ejs
v0.1.0
Published
EJS Template Middleware for Hyper.io
Downloads
84
Maintainers
Readme
hyper.io-handlebars
EJS Template Middleware for Hyper.io
NPM
$ npm install hyper.io-ejs
Use
var hyper = require('hyper.io');
var ejs = require('hyper.io-ejs');
// add EJS, this is optional,
// hyper.io will auto try to require the 'ejs'
// if it's not included in the middleware already
hyper().use(ejs);
// load config and routes
hyper().start({
routes: [
{
view: "/hello",
template: "hello <%= hello %> - <%= ts %>",
method: {
get: function world($done)
{
$done( {
hello: "world",
ts: new Date()
} );
}
}
}
]
});