0.2.4 • Published 9 months ago

api-call-simplifier v0.2.4

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

api-call-simplifier

A small library that makes it easy to write a client to work with the API.

Installation

$ npm i -S api-call-simplifier

Usage

NodeJS example

const axios = require('axios');
const API = require('api-call-simplifier');


const { apiCall, resource } = API(axios.create({
    baseURL: 'https://jsonplaceholder.typicode.com',
}));

const api = {
    posts: resource('/posts'),
    comments: resource('/comments'),
    albums: resource('/albums'),
    photos: resource('/photos'),
    todos: resource('/todos'),
    users: resource('/users'),
    post: {
        comments: resource('/posts/<id>/comments')
    }
};

NuxtJS example

Edit demo-api-call-simplifier

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

comment: <> (## History)

comment: <> (TODO: Write history)

comment: <> (## Credits)

comment: <> (TODO: Write credits)

comment: <> (## License)

comment: <> (TODO: Write license)

0.2.1

9 months ago

0.2.3

9 months ago

0.2.2

9 months ago

0.2.4

9 months ago

0.2.0

2 years ago

0.1.0

2 years ago