Netflix / falcor-hapi

Falcor middleware for Hapi app server
Apache License 2.0
55 stars 26 forks source link

falcor-hapi

Server middleware for falcor-hapi

Working usage example in falcor-hapi-demo repo

Usage

Minimalistic example

var FalcorServer = require('falcor-hapi');
var Hapi = require('hapi');
var TestRouter = <your router here>;

var app = new Hapi.Server();
app.connection({
    host: "localhost",
    port: 9090
});

app.route({
    method: ['GET', 'POST'],
    path: '/model.json',
    handler: FalcorServer.dataSourceRoute(function(req, res) {
        return new TestRouter();
    })
});
app.start();

Hapi Plugin Usage

You can also register this module as an Hapi Plugin and use its provided Falcor handler.

Features

Development

Please run linting before pushing on repo

npm run lint

Todo