0.1.2 • Published 4 years ago
@crosspath/yambus-axios v0.1.2
Yambus
This package contains adapter for generating requests with Axios, used by Yambus.
Yambus generates functions for obtaining paths and making requests to your application.
See more at Yambus project page.
Installation
$ yarn add @crosspath/yambus @crosspath/yambus-axios
Usage
Assume you have generated object with routes in file routes
.
import Routes from 'routes'
// Send request with positional arguments:
Routes.route_name('test-value').then(resp => console.log(resp.data))
// Or with object:
Routes.route_name({url: 'test-value'}).then(resp => console.log(resp.data))
These functions return Promise
. Variable resp
here contains
Axios' wrapper for response. You may get response data as resp.data
.
See Axios documentation for
more information about its response object.
Contributing
Bug reports and pull requests are welcome on GitHub at github.com/crosspath/yambus.
Please do not change version number in pull requests.
License
This package is available as open source under the terms of the MIT License.