0.0.3 • Published 2 years ago

kace-webapi v0.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Kace Webapi

Installing

Using npm:

$ npm install kace-webapi

Using yarn:

$ yarn add kace-webapi

Example

In order to create your own Web Api SDK, you can make use of this library.

// Import the webapi base class
const WebApi = require("kace-webapi") 

// Extends the Webapi methods using mixin with your own methods.
WebApi.mixin({
  hello: function() {
    return this.request()
      .withPath("https://swapi.dev/api/people")
      .build()
      .execute("GET")
  }
})

// Create your webapi
const webApi = new WebApi()

webApi.hello()
    .then(console.log)
    .catch(console.error)