Skip to content

zkochan/hapi-vtree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hapi-vtree

hapi.js plugin for replying with Virtual DOM.

Dependency Status Build Status npm version

Installation

npm install --save hapi-vtree

Usage

Register the plugin:

var Hapi = require('hapi');
var hapiVtree = require('hapi-vtree');

var server = new Hapi.Server();

server.register(hapiVtree, function(err) {
  if (err) {
    console.log("Failed to load hapi-vtree.");
  }
});

Reply with a virtual tree in your handler:

var h = require('virtual-dom/h');

server.route({
  method: 'GET',
  path: '/',
  handler: function(request, reply) {
    var vtree = h('div', 'Hello world!');
    reply.vtree(vtree);
  }
});

License

MIT © Zoltan Kochan

About

Replying Virtual DOM support for hapi.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published