Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zkochan/hapi-vtree
Replying Virtual DOM support for hapi.js
https://github.com/zkochan/hapi-vtree
Last synced: 29 days ago
JSON representation
Replying Virtual DOM support for hapi.js
- Host: GitHub
- URL: https://github.com/zkochan/hapi-vtree
- Owner: zkochan
- License: mit
- Created: 2015-10-17T20:25:37.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-22T15:12:50.000Z (almost 8 years ago)
- Last Synced: 2024-11-25T07:33:45.569Z (about 2 months ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hapi-vtree
[hapi.js](http://hapijs.com/) plugin for replying with [Virtual DOM](https://github.com/Matt-Esch/virtual-dom/).
[![Dependency Status](https://david-dm.org/zkochan/hapi-vtree/status.svg?style=flat)](https://david-dm.org/zkochan/hapi-vtree)
[![Build Status](https://travis-ci.org/zkochan/hapi-vtree.svg?branch=master)](https://travis-ci.org/zkochan/hapi-vtree)
[![npm version](https://badge.fury.io/js/hapi-vtree.svg)](http://badge.fury.io/js/hapi-vtree)## Installation
```
npm install --save hapi-vtree
```## Usage
Register the plugin:
```js
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:
```js
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](https://www.kochan.io)