GithubHelp home page GithubHelp logo

kryndex / moleculer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from moleculerjs/moleculer

0.0 2.0 0.0 13.88 MB

:rocket: Fast & powerful microservices framework for NodeJS

Home Page: https://moleculer.services/

License: MIT License

JavaScript 100.00%

moleculer's Introduction

Moleculer logo

Build Status Coverage Status Codacy Badge Code Climate David Known Vulnerabilities Join the chat at https://gitter.im/ice-services/moleculer

Downloads FOSSA Status

Moleculer NPM version

Moleculer is a fast, modern and powerful microservices framework for NodeJS (>= v6.x).

Website: https://moleculer.services

Documentation: https://moleculer.services/docs

What's included

  • Promise-based solution
  • request-reply concept
  • support event driven architecture with balancing
  • built-in service registry & auto discovery
  • load balanced requests & events (round-robin, random, custom)
  • supports middlewares
  • service mixins
  • multiple services on a node/server
  • built-in caching solution (memory, Redis)
  • pluggable transporters (NATS, MQTT, Redis)
  • pluggable serializers (JSON, Avro, MsgPack, Protocol Buffer)
  • pluggable validator
  • all nodes are equal, no master/leader node
  • parameter validation with fastest-validator
  • distributed timeout handling with fallback response
  • health monitoring, metrics & statistics
  • supports versioned services
  • official API gateway module and many other modules...

Installation

$ npm install moleculer --save

or

$ yarn add moleculer

Create your first microservice

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

const { ServiceBroker } = require("moleculer");

let broker = new ServiceBroker({ logger: console });

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

broker.start();

// Call service
broker.call("math.add", { a: 5, b: 3 })
    .then(res => console.log("5 + 3 =", res))
    .catch(err => console.error(`Error occured! ${err.message}`));

Try it on Runkit

Create a Moleculer project

Use the Moleculer CLI tool to create a new Moleculer based microservices project.

  1. Install moleculer-cli globally

    $ npm install moleculer-cli -g
  2. Create a new project (named first-demo)

    $ moleculer init project-simple first-demo

    Press Y on API Gateway & npm install

  3. Open project folder

    $ cd first-demo
  4. Start project

    $ npm run dev
  5. Open the http://localhost:3000/greeter/welcome?name=world link in your browser. It will call the welcome action of greeter service with a name param via API gateway and returns with the result.

๐ŸŽ‰Congratulations! Your first Moleculer based microservices project is created. Read our documentation to learn more about Moleculer.

Official modules

We have many official modules for Moleculer. Check our list!

Documentation

You can find here the documentation.

Changelog

See CHANGELOG.md.

Roadmap

See ROADMAP.md.

Contributions

We welcome you to join to the development of Moleculer. Please read our contribution guide.

License

Moleculer is available under the MIT license.

3rd party licenses

Contact

Copyright (c) 2016-2017 Ice Services

@ice-services @MoleculerJS

moleculer's People

Contributors

birkenstab avatar colonelbundy avatar dduncan1987 avatar efueger avatar gitter-badger avatar greenkeeper[bot] avatar icebob avatar imatefx avatar nathan-schwartz avatar rhzs avatar rmccallum81 avatar rodrigogs avatar ryanm-pm avatar wolfulus avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.