All Projects → zygos → moleculer-adapter-feathers

zygos / moleculer-adapter-feathers

Licence: MIT license
Moleculer service mixin wrapping Feathers.js services

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to moleculer-adapter-feathers

FlipED
A LMS built specifically for Thailand's Education 4.0 system.
Stars: ✭ 24 (+41.18%)
Mutual labels:  feathers, feathersjs
Feathers
A framework for real-time applications and REST APIs with JavaScript and TypeScript
Stars: ✭ 13,761 (+80847.06%)
Mutual labels:  feathers, feathersjs
flutter feathersjs.dart
Communicate with your feathers js server from flutter app with unbelieved ease and make happy your customers.
Stars: ✭ 19 (+11.76%)
Mutual labels:  feathers, feathersjs
feathers-versionate
Create and work with nested services.
Stars: ✭ 29 (+70.59%)
Mutual labels:  feathers, feathersjs
myethereumapp
Web client for viewing data from the Etherscan API
Stars: ✭ 18 (+5.88%)
Mutual labels:  feathersjs
feathers-example-fileupload
A feathers file upload example, using feathers-blob.
Stars: ✭ 58 (+241.18%)
Mutual labels:  feathers
mostly-node
Mostly simple way to microservices in Node.js
Stars: ✭ 18 (+5.88%)
Mutual labels:  feathers
Awesome Cheatsheets
👩‍💻👨‍💻 Awesome cheatsheets for popular programming languages, frameworks and development tools. They include everything you should know in one single file.
Stars: ✭ 26,007 (+152882.35%)
Mutual labels:  feathersjs
mobx-crud-example
A crud mobx project using react, featherjs and mongodb
Stars: ✭ 22 (+29.41%)
Mutual labels:  feathersjs
feathers-objection
Feathers database adapter for Objection.js, an ORM based on KnexJS SQL query builder for Postgres, Redshift, MSSQL, MySQL, MariaDB, SQLite3, and Oracle. Forked from feathers-knex.
Stars: ✭ 89 (+423.53%)
Mutual labels:  feathersjs
krawler
A minimalist (geospatial) ETL
Stars: ✭ 51 (+200%)
Mutual labels:  feathersjs
Moonshine-IDE
Moonshine is a free and open source middleweight IDE built with ActionScript 3 for ActionScript 3, Apache Flex®, Apache Royale™, and Feathers development, with Cloud and Desktop support.
Stars: ✭ 86 (+405.88%)
Mutual labels:  feathers
feathers-next-example
Use feathers with next.js
Stars: ✭ 41 (+141.18%)
Mutual labels:  feathers
feathers-blob
Feathers service for blob storage, like S3.
Stars: ✭ 89 (+423.53%)
Mutual labels:  feathersjs
feathers-solr
Feathersjs Solr Client
Stars: ✭ 29 (+70.59%)
Mutual labels:  feathers
moleculer-repl
REPL module for Moleculer framework
Stars: ✭ 24 (+41.18%)
Mutual labels:  moleculer
feathers-swift
FeathersJS Swift SDK, written with love.
Stars: ✭ 51 (+200%)
Mutual labels:  feathers
feathers-vuex-todomvc
Feathers-vuex TodoMVC demo
Stars: ✭ 29 (+70.59%)
Mutual labels:  feathers
moleculer-node-realworld-example-app
Exemplary real world application built with Moleculer
Stars: ✭ 102 (+500%)
Mutual labels:  moleculer
moleculer
🚀 Progressive microservices framework for Go - based and compatible with https://github.com/moleculerjs/moleculer
Stars: ✭ 135 (+694.12%)
Mutual labels:  moleculer

moleculer-adapter-feathers

Moleculer adapter to import feathers services. That includes:

  • MongoDB
  • Blob store
  • Bookshelf
  • CouchDB
  • Elasticsearch
  • Knex
  • Mongoose
  • NeDB
  • RethinkDB
  • Sequalize
  • Waterline
  • and many others

Install

$ npm install moleculer-adapter-feathers --save

Usage (example with Knex)

const Feathers = require("moleculer-adapter-feathers");
const { ServiceBroker } = require("moleculer");
const feathersKnex = require("feathers-knex");
const knex = require("knex");

const broker = new ServiceBroker();

// Create a DB service via knex for `user` entities
broker.createService({
    name: "users",
    mixins: [Feathers],
    settings: {
        feathers: {
            adapter: feathersKnex,
            options: {
                name: "users",
                Model: new knex({
                    client: "pg",
                    connection: { ... },
                }),
            },
        },
    },
});

broker.start()
// Create a new user
.then(() => broker.call("users.create", {
    username: "john",
    email: "[email protected]",
}))

// Get all users
.then(() => broker.call("users.find").then(console.log));

Settings

Property Type Default Description
adapter `Object Function` required
hooks Object {} Object containing before and after hooks.
options Object {} Options passed to Feathers service adapter.

Hooks

Hooks work just as they do in Feathers. They are passed down to a service in settings.feathers.hooks.

users.service.js

module.exports = {
    ...
    settings: {
        feathers: {
            adapter: feathersKnex,
            hooks: require('./hooks'),
            options: {
                name: "users",
                Model: new knex({
                    client: "pg",
                    connection: { ... },
                }),
            },
        },
    },
    ...
}

hooks.js

module.exports = {
    before: {
        create: [
            hook => {
                console.log('create hook')
                return hook
            },
        ],
        find: [],
        get: [],
        update: [],
        patch: [],
        remove: [],
    },
    after: {
        create: [],
        find: [],
        get: [],
        update: [],
        patch: [],
        remove: [],
    },
}

Actions

Standard Feathers actions are exposed: create, get, find, update, patch, remove with all the standard Feathers parameters. Actions can be overwritten.

Methods

Feathers service methods can be accessed directly via this.create, this.find and etc.

create

Create an object in a service.

Parameters

Property Type Default Description
* Any {} Object to be created.

Results

Type: Object

Created object (or any other service response).

find

Find objects by a provided query, if any.

Parameters

Property Type Default Description
* Any {} Query specified by the service.

Results

Type: Array[Object]

Array of results.

get

Get object in the service by a provided (unique) ID.

Parameters

Property Type Default Description
id `String Number` required

Results

Type: Object

Object found by the ID.

patch

Changes the properties of an object.

Parameters

Property Type Default Description
id `String Number` required
* Any {} Values to be patched.

Results

Type: Object

Object patched.

update

Overwrites an object's properties.

Parameters

Property Type Default Description
id `String Number` required
* Any {} Rest of the object.

Results

Type: Object

Object updated.

remove

Remove object by ID.

Parameters

Property Type Default Description
id `String Number` required

Results

Type: Object

Object removed.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].