apeman-api-client

1.1.2 • Public • Published

apeman-api-client

Build Status Code Climate Code Coverage npm Version JS Standard

Client for apeman api

Installation

$ npm install apeman-api-client --save

Usage

#!/usr/bin/env node
 
/**
 * This is an example of rfunc client
 */
'use strict'
 
const apemanApi = require('apeman-api-client')
const co = require('co')
 
co(function * () {
  let api = apemanApi('http://myapp.example.com')
  
  let sign = yield api.connect('sign') // Define a client
 
  // Call remote api and receive the result
  let { success } = yield sign.signin('foo', 'bar1234')
  console.log('success:', success)
 
  {
    // Access to scoped api
    let admin = api.of('@admin')
    let user = admin.user()
    yield user.destroy(1)
    /* ... */
  }
}).catch((err) => console.error(err))
 

License

This software is released under the MIT License.

Links

Readme

Keywords

Package Sidebar

Install

npm i apeman-api-client

Weekly Downloads

1

Version

1.1.2

License

MIT

Last publish

Collaborators

  • okunishinishi