README.md in moleculer-0.1.0 vs README.md in moleculer-0.1.1

- old
+ new

@@ -1,6 +1,8 @@ # Moleculer +![Moleculer logo](https://github.com/moleculerjs/moleculer/raw/master/docs/assets/logo.png) + [![Build Status](https://travis-ci.org/moleculer-ruby/moleculer.svg?branch=develop)](https://travis-ci.org/moleculer-ruby/moleculer) [![Maintainability](https://api.codeclimate.com/v1/badges/d4211bbefca62cb4c10e/maintainability)](https://codeclimate.com/github/moleculer-ruby/moleculer/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/d4211bbefca62cb4c10e/test_coverage)](https://codeclimate.com/github/moleculer-ruby/moleculer/test_coverage) Moleculer is a fast, modern and powerful microservices framework for originally written for [Node.js](). It helps you to @@ -20,24 +22,65 @@ - pluggable validator - multiple services on a node/server - all nodes are equal, no master/leader node +## Getting Started +### Install the Gem + +```ruby +gem install "moleculer-ruby" +``` + +or add to your Gemfile: + +```ruby +gem "moleculer-ruby", "~>0.1" +``` + +### Create a Simple Service + +```ruby +class SimpleService < Moleculer::Service::Base + action :get_user, :get_user + + + def get_user + # .. usery getting stuff + end +end + + +Moleculer.config do |c| + c.services << SimpleService +end + +Moleculer.start + +``` + + ## Configuration Moleculer is configured through the Moleculer::config method. Example: ```ruby -Moleculer.config do |c| - c.log_level :debug +Moleculer.configure do |c| + c.log_level = :debug end ``` ### Configuration Options +#### logger (default: Ougai::Logger) +Sets teh Moleculer logger, this must be a Ruby `Logger` or `Ougai` compatible logger. + #### log_level (default: debug) Sets the log level of the node. defaults to `:debug`. Can be one of `:trace`, `:debug`, `:info`, `:warn`, `:error`, `:fatal`. + +#### heartbeat_interval (default: 5) +The interval in which to send heartbeats. #### node_id (default: \<hostname\>-\<pid\>) The node id. Node IDs are required to be unique. In Moleculer-ruby all node ids are suffixed with the PID of the running process, allowing multiple copies of the same node to be run on the same machine. When using a containerized environment (i.e. Docker), it is suggested that the node_id also include a random set of characters as there is a chance