hyper.io-ejs

0.1.0 • Public • Published

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()
                    } );
                }
            }
        }
    ]
});

Package Sidebar

Install

npm i hyper.io-ejs

Weekly Downloads

1

Version

0.1.0

License

MIT

Last publish

Collaborators

  • jstty