0.5.0-rc.4 • Published 6 years ago

weave-core v0.5.0-rc.4

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

npm version Maintainability npm version Downloads

Weave

Weave is a fast and easy to use microservice framework for NodeJS (>= v6.x).

Features

  • Service mixins
  • Multiple services per node
  • Request-reply concept
  • Event bus system
  • Supports middlewares
  • Pluggable transporters (NATS, Redis)
  • Automatic service discovery
  • Load balanced requests (round-robin, random)
  • No master/leader node
  • Distributed timeout handling with fallback response
  • Health monitoring, metrics & statistics

Installation

$ npm install weave-core --save

Quick start

This example shows you how to create a small service with an add action which can add two numbers.

const { Weave } = require('weave-core')

let broker = Weave({ logLevel: 'debug' })

broker.createService({
    name: 'math',
    actions: {
        add(ctx) {
            return Number(ctx.params.a) + Number(ctx.params.b)
        }
    }
});

broker.start()
    .then(() => {
        // Call service
        broker.call('math.add', { a: 5, b: 3 })
            .then(result => console.log('5 + 3 =', result))
            .catch(error => console.error(`Something went wrong! ${error.message}`))
    })

Sample applications

There are a number of sample applications available:

    // todo

Documentation

Comming soon

Changelog

See changelog.md.

Roadmap

See roadmap.md.

License

The weave framework is available under the MIT license.

Contact

Copyright (c) 2018 by Fachwerk