README.md
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
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Конвейеры
0 успешных
0 с ошибкой