0.1.1 • Published 8 years ago
just-match-client v0.1.1
JustMatch API Client
A JavaScript client for JustMatch API.
Install
npm install --save just-match-client
Usage
var Client = require('just-match-client');
var client = new Client({
baseURL: 'http://localhost:3000',
promoCode: 'xyz', // Optional
__debug__: true // Toggle debugging output
});
// Get all jobs sorted by their updated at attribute
client.jobs.index().GET({sort: ['-updated-at']}).then(function(res) {
var data = res.data.data;
var job;
for (var i = 0; i < data.length; i++) {
job = data[i].attributes;
console.log(data[i]['id'], job['name'], job['updated-at']);
}
});
Fore more in depth examples see example.js
.
Todo
- Implement convenience methods for
login
/logout
- ...