@jswork/web-http-schema
TypeScript icon, indicating that this package has built-in type declarations

2.0.13 • Public • Published

web-http-schema

Http schema for web based on next-fetch.

version license size download

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.

/@jswork/web-http-schema/

    Package Sidebar

    Install

    npm i @jswork/web-http-schema

    Weekly Downloads

    0

    Version

    2.0.13

    License

    MIT

    Unpacked Size

    5.96 kB

    Total Files

    5

    Last publish

    Collaborators

    • afeiship