Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

IOPA
iopa-templates

Build Status IOPA limerun

NPM

About

iopa-templates is IOPA middleware for rendering templates using template engine such as handlebars, moustache, dust, razor, etc

Installation

$ npm install iopa-templates

Goals and Features

  • Ability to support layouts

  • Ability to support partials

  • Ability to support precompiled templates for use on the client

  • Ability to use a different template engines

Installation

Install using npm:

$ npm install iopa-templates

Basic Usage

const iopa = require('iopa'),
      templates = require('iopa-templates'),
      handlebars = require('iopa-handlebars'),
      razor = require('iopa-razor')

var app = new iopa.App();
app.use(templates);
app.engine('.hbs', handlebars.engine({defaultLayout: 'main', views: 'test/views', partials: 'test/views/partials'}));
app.engine('.js.html', razor.engine({defaultLayout: 'index', views: 'test/views'}));

app.use(function(context, next) {
    return context.render('home.hbs', {modelkey: "value"} );
});

http.createServer(app.buildHttp()).listen(3000);

License

Apache 2

About

Template Engine for IOPA fabric for Handlebars, Mustache, Dust, Razor etc.

Resources

License

Releases

No releases published

Packages

No packages published
You can’t perform that action at this time.