0.1.0 • Published 8 years ago

volvox-core v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

volvox.js - Self announcing services

npm.io

Volvox.js simple framework with powerful service discovery using Consul or ETCD

Build Status Coverage Status

Just develop your app using your favorite framework Express, Hapi, Restify etc then Volvox.js takes care of the rest. It starts application on available port registers application to Consul or ETCD and starts worker that polls for critical instances and deregister them. volvox.js provides /status endpoint for Consul Health Checks. Also, it provides client to select random instance to communicate.

npm.io

Here is sample code shows express.js and Consul integration

import Volvox from 'volvox-core';
import vconsul from 'volvox-consul';
import vexpress from 'volvox-express';

import express from 'express'

async function main() {
    let server = express();

    server.get('/customers', (req, res) => {
       res.send({
            customerName: "Test customer",
            customerId: 666
        });
    });

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

main();