just-match-client

0.1.1 • Public • Published

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
  • ...

Package Sidebar

Install

npm i just-match-client

Weekly Downloads

1

Version

0.1.1

License

MIT

Last publish

Collaborators

  • buren