machinary

0.0.81 • Public • Published

Machinary

NPM

Machinary's a modular real-time data synchronization API. You can read all our documentation at https://docs.machinary.ninja/

Store all data you need for an improved connection and use them wherever you want.

To Start a new project on machinary it is necessary install machinary.

Installing Machinary

$ npm install -g machinary

Installing rethinkdb.

You need to install rethinkdb to run as machinary's database. Access http://rethinkdb.com/install

Starting a new project with machinary

$ machinary init <folder>

Authenticating

Listing Autentications

cd ./<your-project>
$ machinary auth list

Creating a new authentication

cd ./<your-project>
$ machinary auth new -PUDG --addr *

It will return you a new authentication and token that you can use at your project.

Runing the new project

$ machinary start

It will start at the port 9500.

Installing the API on your project.

On JavaScript

Include our library in your project:

<script src="http://127.0.0.1:9500/machinary_public/machinary.min.js"></script>

Using at javascript project

var auth = btoa(JSON.stringify({auth:'<auth>', token: '<token>'}));
var machine = Machinary('http://127.0.0.1:9500', auth, [<modules-to-be-included>]);

Example:

var auth = btoa(JSON.stringify({auth:'da39a3ee5e6b4b0d3255bfef95601890afd80709', token: 'a0f1490a20d0211c997b44bc357e1972deab8ae3'}));
var machine = Machinary('http://127.0.0.1:9500', auth, ['raw']);

Saving data at the database.

machine.set('/raw', {
  body: {
    author: "John  Doe",
    title: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
    post: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse scelerisque purus non maximus congue. Nullam ornare enim ut eros consequat fringilla."
  }
});

Package Sidebar

Install

npm i machinary

Weekly Downloads

0

Version

0.0.81

License

MIT

Last publish

Collaborators

  • tresna