nachos-server-api
v1.0.1
Published
The official nachos server side api
Downloads
4
Readme
server-api
Nachos server side api
Have a problem? Come chat with us!
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:'[email protected]', 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