dietjs support for ejs template engine
For more informations about dietjs framework: diet.js
For more informations about the ejs template engine : http://ejs.co/
npm install --save diet-ejs
index.js
var app=require('diet')();
var ejs=require('diet-ejs')();
app.header(ejs);
app.get('/',function($){
$.data.message='John';
$.render('index');
});
app.listen('http://localhost:7500');
index.ejs
<p> Hello <%=message%> </p>
By default the middleware comes with some default settings that you can customize using the options in the module constructor.
var ejs=require('diet-ejs')({
template_dir: './views', //by default the location of the templates is in the views folder
template_ext: 'ejs', //the default extension of the template files is .ejs
debug:false, //no debug info
cache:false //no caching
});