otomatk

0.4.12 • Public • Published

Otomatk

A tiny REST-like mapper for Iridium models with Seneca micro-services toolkit and express.js

Status

Build Status

TODO

  • Add support for express.js
  • More test cases

Install

npm install --save otomatk

Using with seneca.

const Otomatk = require('otomatk');
const Senecafy = Otomatk.Senecafy;
const seneca = require('seneca')();

// You can provide your own seneca role name.
var senecafy = new Senecafy(seneca, rolename);

senecafy.load([IridiumModel]) 

// You can also send as a single iridium model
senecafy.load(IridiumModel);


// Using the senecafied action patterns of the model.
seneca.act({ role: rolename, plugin: IridiumModel.collectionName, cmd: 'list' }, (err, data) => {
  // Other logic.  
}); 

Available Commands

// Similar to seneca data entities.
{ cmd: 'save' }
{ cmd: 'list' }
{ cmd: 'remove' }
{ cmd: 'load' } 

NOTE: The plugin name for all the senecafied patterns are mostly the name of the Iridium Collection/Model (Model.collectionName)

/otomatk/

    Package Sidebar

    Install

    npm i otomatk

    Weekly Downloads

    0

    Version

    0.4.12

    License

    MIT

    Last publish

    Collaborators

    • peek4y