Nachos server side api
Linux | OSX | Windows | Coverage | Dependencies | DevDependencies |
---|---|---|---|---|---|
|
|
|
|
|
$ [sudo] npm install server-api --save
var server = require('server-api');
var client = server();
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
});
Check if a token is cached
client.connected() // true or false
Save a given token in cache
client.setToken('token');
The package reflects all the api from the nachos server
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
$ npm test