Skip to content

iopa-io/iopa-templates

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

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

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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published