This package contains adapter for generating requests with fetch function, used by Yambus.
Yambus generates functions for obtaining paths and making requests to your application.
See more at Yambus project page.
$ yarn add @crosspath/yambus @crosspath/yambus-fetch
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(body => console.log(body))
// Or with object:
Routes.route_name({url: 'test-value'}).then(body => console.log(body))
These functions return Promise
. Variable body
here contains response data.
Expected request & response format is JSON.
Bug reports and pull requests are welcome on GitHub at github.com/crosspath/yambus.
Please do not change version number in pull requests.
This package is available as open source under the terms of the MIT License.