nachos-server-api

1.0.1 • Public • Published

server-api

Nachos server side api

Linux OSX Windows Coverage Dependencies DevDependencies
Coverage Status

Have a problem? Come chat with us!

Join the chat at https://gitter.im/nachos/server-api

Installation

  $ [sudo] npm install server-api --save

Usage

Initialize

var server = require('server-api');
var client = server();

Connecting

Connect to the server with email and password

client.connect({email:'nacho@nachos.io', password:'hola'})
  .then(function(token) {
    // token generated to authenticate - cached in memmory
  });

Connected

Check if a token is cached

client.connected() // true or false

Set token

Save a given token in cache

client.setToken('token');

API

The package reflects all the api from the nachos server

Examples

client.users.me()
  .then(function(me) {
    // me - user data
  });
  
client.packages.all()
  .then(function(packages) {
    // packages - list of all packages
  });

Full documentation can be found here

Run Tests

  $ npm test

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i nachos-server-api

Weekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • amirschl
  • noamokman
  • omrilitov
  • eladbezalel