Home

Awesome

MostlyJS with Feathers

Build Status

This module provides quick ways to create MostlyJS microservices with Feathers.

Documentation

Please see the documentation site.

Usage

Installation

npm install mostly-feathers --save

Quick Example

Convert your Feathers APIs into microservices is easy enough.

Your existing Feathers code

// service.js
const memory = require('feathers-memory');

module.exports = function() {
  const app = this;

  // initialize service
  const service = new memory();
  app.use('dummies', service);
}

Wrapping it as standalone server

const nats = require('nats');
const mostly = require('mostly-node');
const feathers = require('mostly-feathers');
const service = require('./service');

const trans = new mostly(nats.connect());
trans.ready(() => {
  var app = feathers(trans)
    .configure(service);
});

That's all, the service will register itself with NATS and can be called remotely.

RESTful Gateway

To expose the service as RESTful api, you need only setup a simple express gateway server using mostly-feathers-rest

License

MIT