Skip to content

justinkadima/diet-ejs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

diet-ejs

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/

instalation

npm install --save diet-ejs

example

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>

customisation

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

About

dietjs support for ejs template engine

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published