web-http-schema
Http schema for web based on next-fetch.
installation
npm install @jswork/web-http-schema
usage
import httpSchema from '@jswork/web-http-schema';
const options = {
transformResponse: ({ data }) => {
return data;
}
};
const $api = httpSchema(
{
host: 'https://api.github.com',
request: ['', 'json'],
items: [
{
items: {
login: ['get', '/users/afeiship']
}
}
]
},
options
);
$api.login().then((res) => {
// res
});
license
Code released under the MIT license.