Skip to content

Latest commit

 

History

History
executable file
·
35 lines (25 loc) · 1.04 KB

File metadata and controls

executable file
·
35 lines (25 loc) · 1.04 KB

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();