Skip to content

ziyasal/volvox-hapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

microphone-hapi

Hapi.js provider for volvox.js Microservice framework

Build Status Coverage Status

Preview

Sample code using Consul

import Volvox from 'volvox-core';
import vconsul from 'volvox-consul';
import vhapi from 'volvox-hapi';

import hapi from 'hapi'

async function main() {
    let server = new hapi.Server();

    server.route({method: 'GET', path: '/customers', handler: (req, reply) {
        reply({
            customerName: "Test customer",
            customerId: 666
        });
    }});

    let volvox = new Volvox(vconsul(), vhapi());
    await volvox.bootstrap(server, "customers", "v1");
}

main();